[gtk] testsuite: Fix stylecontext test



commit 023b69542232095245b688176da4a4964a149cdd
Author: Benjamin Otte <otte redhat com>
Date:   Thu Apr 11 22:41:04 2019 +0200

    testsuite: Fix stylecontext test
    
    Update the test to the stricter interpretation of the CSS specification
    and the removal of custom additions.

 testsuite/gtk/stylecontext.c | 69 ++++++++++++++++++++++----------------------
 1 file changed, 34 insertions(+), 35 deletions(-)
---
diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c
index 4275b31e4a..5bdfadfc56 100644
--- a/testsuite/gtk/stylecontext.c
+++ b/testsuite/gtk/stylecontext.c
@@ -22,8 +22,8 @@ test_parse_selectors (void)
     "#id {}",
     "tab:first-child {}",
     "tab:last-child {}",
-    "tab:nth-child(first) {}",
-    "tab:nth-child(last) {}",
+    "tab:first-child {}",
+    "tab:last-child {}",
     "tab:nth-child(even) {}",
     "tab:nth-child(odd) {}",
     ".some-class {}",
@@ -47,8 +47,8 @@ test_parse_selectors (void)
     "E1.e1_2 #T3_4 {}",
     "E:first-child {}",
     "E:last-child {}",
-    "E:nth-child(first) {}",
-    "E:nth-child(last) {}",
+    "E:first-child {}",
+    "E:last-child {}",
     "E:nth-child(even) {}",
     "E:nth-child(odd) {}",
     "E:focus tab {}",
@@ -148,76 +148,76 @@ test_match (void)
                                   GTK_STYLE_PROVIDER (provider),
                                   GTK_STYLE_PROVIDER_PRIORITY_USER);
 
-  data = "* { color: #fff }";
+  data = "* { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         "button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "button { color: #fff }\n"
-         "window > button { color: #000 }";
+  data = "* { color: #f00; }\n"
+         "button { color: #fff; }\n"
+         "window > button { color: #000; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         ".button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         ".button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "button { color: #000 }\n"
-         ".button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         "button { color: #000; }\n"
+         ".button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "button { color: #000 }\n"
-         "window button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         "button { color: #000; }\n"
+         "window button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         ".button { color: #000 }\n"
-         "window .button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         ".button { color: #000; }\n"
+         "window .button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "* .button { color: #000 }\n"
-         "#mywindow .button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         "* .button { color: #000; }\n"
+         "#mywindow .button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "window .button { color: #000 }\n"
-         "window#mywindow .button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         "window .button { color: #000; }\n"
+         "window#mywindow .button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "window .button { color: #000 }\n"
-         "window button.button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         "window .button { color: #000; }\n"
+         "window button.button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
 
-  data = "* { color: #f00 }\n"
-         "window:backdrop .button { color: #000 }\n"
-         "window .button { color: #111 }\n"
-         "window:active .button { color: #fff }";
+  data = "* { color: #f00; }\n"
+         "window:backdrop .button { color: #000; }\n"
+         "window .button { color: #111; }\n"
+         "window:active .button { color: #fff; }";
   gtk_css_provider_load_from_data (provider, data, -1);
   gtk_style_context_get_color (context, &color);
   g_assert (gdk_rgba_equal (&color, &expected));
@@ -532,6 +532,5 @@ main (int argc, char *argv[])
   ADD_PRIORITIES_TEST ("three-context-higher", test_style_priorities_three_context_higher);
 
 #undef ADD_PRIORITIES_TEST
-
   return g_test_run ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]