patch 8.1.1626: no test for closing a popup window with a modified buffer

Problem:    No test for closing a popup window with a modified buffer.
Solution:   Add a test.  Add "popups" to getbufinfo().
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 7c9860f..925040d 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4509,10 +4509,10 @@
     dict_add_number(dict, "hidden",
 			    buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0);
 
-    /* Get a reference to buffer variables */
+    // Get a reference to buffer variables
     dict_add_dict(dict, "variables", buf->b_vars);
 
-    /* List of windows displaying this buffer */
+    // List of windows displaying this buffer
     windows = list_alloc();
     if (windows != NULL)
     {
@@ -4522,6 +4522,23 @@
 	dict_add_list(dict, "windows", windows);
     }
 
+#ifdef FEAT_TEXT_PROP
+    // List of popup windows displaying this buffer
+    windows = list_alloc();
+    if (windows != NULL)
+    {
+	for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
+	    if (wp->w_buffer == buf)
+		list_append_number(windows, (varnumber_T)wp->w_id);
+	FOR_ALL_TABPAGES(tp)
+	    for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
+		if (wp->w_buffer == buf)
+		    list_append_number(windows, (varnumber_T)wp->w_id);
+
+	dict_add_list(dict, "popups", windows);
+    }
+#endif
+
 #ifdef FEAT_SIGNS
     if (buf->b_signlist != NULL)
     {
@@ -5685,7 +5702,7 @@
     if (l != NULL)
     {
 	for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
-		wp; wp = wp->w_next)
+						   wp != NULL; wp = wp->w_next)
 	    list_append_number(l, (varnumber_T)wp->w_id);
 	dict_add_list(dict, "windows", l);
     }