[gtk+] tests: Move declaration tests to new test infrastructure



commit d56e8c8e548441d601a2b3e4123393b0a34502be
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jul 21 02:41:42 2011 +0200

    tests: Move declaration tests to new test infrastructure
    
    This way, we can test more feature of them, in particular check for
    different errors, which were causing test failures.

 gtk/tests/stylecontext.c                         |   83 ----------------------
 gtk/tests/test.png                               |  Bin 3569 -> 0 bytes
 tests/css/parser/Makefile.am                     |   75 +++++++++++++++++++
 tests/css/parser/declarations-invalid-01.css     |    1 +
 tests/css/parser/declarations-invalid-01.errors  |    1 +
 tests/css/parser/declarations-invalid-02.css     |    1 +
 tests/css/parser/declarations-invalid-02.errors  |    1 +
 tests/css/parser/declarations-invalid-02.ref.css |    3 +
 tests/css/parser/declarations-invalid-03.css     |    1 +
 tests/css/parser/declarations-invalid-03.errors  |    1 +
 tests/css/parser/declarations-invalid-03.ref.css |    3 +
 tests/css/parser/declarations-invalid-04.css     |    1 +
 tests/css/parser/declarations-invalid-04.errors  |    1 +
 tests/css/parser/declarations-invalid-04.ref.css |    3 +
 tests/css/parser/declarations-invalid-05.css     |    1 +
 tests/css/parser/declarations-invalid-05.errors  |    1 +
 tests/css/parser/declarations-invalid-05.ref.css |    3 +
 tests/css/parser/declarations-invalid-06.css     |    1 +
 tests/css/parser/declarations-invalid-06.errors  |    1 +
 tests/css/parser/declarations-invalid-06.ref.css |    3 +
 tests/css/parser/declarations-invalid-07.css     |    1 +
 tests/css/parser/declarations-invalid-07.errors  |    1 +
 tests/css/parser/declarations-invalid-07.ref.css |    3 +
 tests/css/parser/declarations-invalid-08.css     |    1 +
 tests/css/parser/declarations-invalid-08.errors  |    3 +
 tests/css/parser/declarations-valid-01.css       |    1 +
 tests/css/parser/declarations-valid-02.css       |    1 +
 tests/css/parser/declarations-valid-02.ref.css   |    7 ++
 tests/css/parser/declarations-valid-03.css       |    1 +
 tests/css/parser/declarations-valid-03.ref.css   |    7 ++
 tests/css/parser/declarations-valid-04.css       |    1 +
 tests/css/parser/declarations-valid-04.ref.css   |    7 ++
 tests/css/parser/declarations-valid-05.css       |    1 +
 tests/css/parser/declarations-valid-05.ref.css   |    3 +
 tests/css/parser/declarations-valid-06.css       |    1 +
 tests/css/parser/declarations-valid-07.css       |    3 +
 tests/css/parser/declarations-valid-08.css       |    1 +
 tests/css/parser/declarations-valid-08.ref.css   |    7 ++
 tests/css/parser/declarations-valid-09.css       |    1 +
 tests/css/parser/declarations-valid-09.ref.css   |    4 +
 tests/css/parser/declarations-valid-10.css       |    1 +
 tests/css/parser/declarations-valid-10.ref.css   |    6 ++
 tests/css/parser/declarations-valid-11.css       |    1 +
 tests/css/parser/declarations-valid-11.ref.css   |    6 ++
 tests/css/parser/declarations-valid-12.css       |    1 +
 tests/css/parser/declarations-valid-12.ref.css   |    6 ++
 tests/css/parser/declarations-valid-13.css       |    1 +
 tests/css/parser/declarations-valid-13.ref.css   |    6 ++
 tests/css/parser/declarations-valid-14.css       |    1 +
 tests/css/parser/declarations-valid-14.ref.css   |    6 ++
 tests/css/parser/declarations-valid-15.css       |    1 +
 tests/css/parser/declarations-valid-15.ref.css   |    6 ++
 tests/css/parser/declarations-valid-16.css       |    1 +
 tests/css/parser/declarations-valid-16.ref.css   |   10 +++
 tests/css/parser/declarations-valid-17.css       |    1 +
 tests/css/parser/declarations-valid-17.ref.css   |    6 ++
 tests/css/parser/declarations-valid-18.css       |    1 +
 tests/css/parser/declarations-valid-18.errors    |    1 +
 tests/css/parser/declarations-valid-19.css       |    3 +
 tests/css/parser/declarations-valid-19.ref.css   |    3 +
 tests/css/parser/declarations-valid-20.css       |    5 ++
 tests/css/parser/declarations-valid-20.ref.css   |    3 +
 tests/css/parser/declarations-valid-21.css       |    6 ++
 tests/css/parser/declarations-valid-21.ref.css   |    3 +
 tests/css/parser/declarations-valid-22.css       |    1 +
 tests/css/parser/declarations-valid-22.ref.css   |    6 ++
 tests/css/parser/declarations-valid-23.css       |    1 +
 tests/css/parser/declarations-valid-23.ref.css   |    6 ++
 tests/css/parser/declarations-valid-24.css       |    1 +
 tests/css/parser/declarations-valid-24.ref.css   |    3 +
 tests/css/parser/declarations-valid-25.css       |    1 +
 tests/css/parser/declarations-valid-25.ref.css   |    3 +
 tests/css/parser/test.png                        |  Bin 0 -> 148 bytes
 73 files changed, 264 insertions(+), 83 deletions(-)
---
diff --git a/gtk/tests/stylecontext.c b/gtk/tests/stylecontext.c
index b107515..733e1fd 100644
--- a/gtk/tests/stylecontext.c
+++ b/gtk/tests/stylecontext.c
@@ -67,88 +67,6 @@ test_parse_selectors (void)
 }
 
 static void
-test_parse_declarations (void)
-{
-  GtkCssProvider *provider;
-  GError *error;
-  gboolean res;
-  gint i;
-  const gchar *valid[] = {
-    "* {}",
-    "* { font: Sans 15 }",
-    "* { font: Sans 15; }",
-    "* { font: bold }",
-    "* { color: red }",
-    "* { /* just a comment */ }",
-    "* { /* multi\nline\ncomment */ }",
-    "* { font: /* comment here */ Sans 15 }",
-    "* { color: red; background-color: shade (@bg_color, 0.5) }",
-    "* { margin: 5 }",
-    "* { margin: 5 10 }",
-    "* { margin: 5 10 3 }",
-    "* { margin: 5 10 3 5 }",
-    "* { padding: 5 }",
-    "* { padding: 5 10 }",
-    "* { border-width: 5; border-radius: 10 }",
-    "* { border-color: #ff00ff }",
-    "* { engine: clearlooks }",
-    "* { background-image: -gtk-gradient (linear,               \n"
-    "                                    left top, right top,   \n"
-    "                                    from (#fff), to (#000)) }",
-    "* { background-image: -gtk-gradient (linear,               \n"
-    "                                    0.0 0.5, 0.5 1.0,      \n"
-    "                                    from (#fff),           \n"
-    "                                    color-stop (0.5, #f00),\n"
-    "                                    to (#000))              }",
-    "* { background-image: -gtk-gradient (radial,               \n"
-    "                                     center center, 0.2,   \n"
-    "                                     center center, 0.8,   \n"
-    "                                     color-stop (0.0,#fff),\n"
-    "                                     color-stop (1.0,#000))}\n",
-    "* { border-image: url(\"" SRCDIR "/test.png\") 3 4 3 4 stretch       }",
-    "* { border-image: url(\"" SRCDIR "/test.png\") 3 4 3 4 repeat stretch}",
-    "* { transition: 150ms ease-in-out                          }",
-    "* { transition: 1s linear loop                             }",
-    NULL
-  };
-
-  const gchar *invalid[] = {
-    "* { color }",
-    "* { color:green; color }",
-    "* { color:red; color; color:green }",
-    "* { color:green; color: }",
-    "* { color:red; color:; color:green }",
-    "* { color:green; color{;color:maroon} }",
-    "* { color:red; color{;color:maroon}; color:green }",
-    "* { content: 'Hello",
-    NULL
-  };
-
-  error = NULL;
-  for (i = 0; valid[i]; i++)
-    {
-      provider = gtk_css_provider_new ();
-      res = gtk_css_provider_load_from_data (provider, valid[i], -1, &error);
-      if (error)
-        g_print ("parsing '%s': got unexpected error: %s\n", valid[i], error->message);
-      g_assert_no_error (error);
-      g_assert (res);
-
-      g_object_unref (provider);
-   }
-
-  for (i = 0; invalid[i]; i++)
-    {
-      provider = gtk_css_provider_new ();
-      res = gtk_css_provider_load_from_data (provider, invalid[i], -1, &error);
-      g_assert_error (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_FAILED);
-      g_assert (!res);
-      g_object_unref (provider);
-      g_clear_error (&error);
-   }
-}
-
-static void
 test_path (void)
 {
   GtkWidgetPath *path;
@@ -432,7 +350,6 @@ main (int argc, char *argv[])
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/style/parse/selectors", test_parse_selectors);
-  g_test_add_func ("/style/parse/declarations", test_parse_declarations);
   g_test_add_func ("/style/path", test_path);
   g_test_add_func ("/style/match", test_match);
   g_test_add_func ("/style/style-property", test_style_property);
diff --git a/tests/css/parser/Makefile.am b/tests/css/parser/Makefile.am
index 86f1f0e..7947ec5 100644
--- a/tests/css/parser/Makefile.am
+++ b/tests/css/parser/Makefile.am
@@ -175,6 +175,81 @@ EXTRA_DIST += \
 	declarations.css \
 	declarations.errors \
 	declarations.ref.css \
+	declarations-invalid-01.css \
+	declarations-invalid-01.errors \
+	declarations-invalid-01.ref.css \
+	declarations-invalid-02.css \
+	declarations-invalid-02.errors \
+	declarations-invalid-02.ref.css \
+	declarations-invalid-03.css \
+	declarations-invalid-03.errors \
+	declarations-invalid-03.ref.css \
+	declarations-invalid-04.css \
+	declarations-invalid-04.errors \
+	declarations-invalid-04.ref.css \
+	declarations-invalid-05.css \
+	declarations-invalid-05.errors \
+	declarations-invalid-05.ref.css \
+	declarations-invalid-06.css \
+	declarations-invalid-06.errors \
+	declarations-invalid-06.ref.css \
+	declarations-invalid-07.css \
+	declarations-invalid-07.errors \
+	declarations-invalid-07.ref.css \
+	declarations-invalid-08.css \
+	declarations-invalid-08.errors \
+	declarations-invalid-08.ref.css \
+	declarations-valid-01.css \
+	declarations-valid-01.ref.css \
+	declarations-valid-02.css \
+	declarations-valid-02.ref.css \
+	declarations-valid-03.css \
+	declarations-valid-03.ref.css \
+	declarations-valid-04.css \
+	declarations-valid-04.ref.css \
+	declarations-valid-05.css \
+	declarations-valid-05.ref.css \
+	declarations-valid-06.css \
+	declarations-valid-06.ref.css \
+	declarations-valid-07.css \
+	declarations-valid-07.ref.css \
+	declarations-valid-08.css \
+	declarations-valid-08.ref.css \
+	declarations-valid-09.css \
+	declarations-valid-09.ref.css \
+	declarations-valid-10.css \
+	declarations-valid-10.ref.css \
+	declarations-valid-11.css \
+	declarations-valid-11.ref.css \
+	declarations-valid-12.css \
+	declarations-valid-12.ref.css \
+	declarations-valid-13.css \
+	declarations-valid-13.ref.css \
+	declarations-valid-14.css \
+	declarations-valid-14.ref.css \
+	declarations-valid-15.css \
+	declarations-valid-15.ref.css \
+	declarations-valid-16.css \
+	declarations-valid-16.ref.css \
+	declarations-valid-17.css \
+	declarations-valid-17.ref.css \
+	declarations-valid-18.css \
+	declarations-valid-18.errors \
+	declarations-valid-18.ref.css \
+	declarations-valid-19.css \
+	declarations-valid-19.ref.css \
+	declarations-valid-20.css \
+	declarations-valid-20.ref.css \
+	declarations-valid-21.css \
+	declarations-valid-21.ref.css \
+	declarations-valid-22.css \
+	declarations-valid-22.ref.css \
+	declarations-valid-23.css \
+	declarations-valid-23.ref.css \
+	declarations-valid-24.css \
+	declarations-valid-24.ref.css \
+	declarations-valid-25.css \
+	declarations-valid-25.ref.css \
 	does-not-exist.css \
 	does-not-exist.errors \
 	does-not-exist.ref.css \
diff --git a/tests/css/parser/declarations-invalid-01.css b/tests/css/parser/declarations-invalid-01.css
new file mode 100644
index 0000000..e1aae2c
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-01.css
@@ -0,0 +1 @@
+* { color }
diff --git a/tests/css/parser/declarations-invalid-01.errors b/tests/css/parser/declarations-invalid-01.errors
new file mode 100644
index 0000000..2cfb1d5
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-01.errors
@@ -0,0 +1 @@
+declarations-invalid-01.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-01.ref.css b/tests/css/parser/declarations-invalid-01.ref.css
new file mode 100644
index 0000000..e69de29
diff --git a/tests/css/parser/declarations-invalid-02.css b/tests/css/parser/declarations-invalid-02.css
new file mode 100644
index 0000000..14df5df
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-02.css
@@ -0,0 +1 @@
+* { color:green; color }
diff --git a/tests/css/parser/declarations-invalid-02.errors b/tests/css/parser/declarations-invalid-02.errors
new file mode 100644
index 0000000..6bee217
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-02.errors
@@ -0,0 +1 @@
+declarations-invalid-02.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-02.ref.css b/tests/css/parser/declarations-invalid-02.ref.css
new file mode 100644
index 0000000..272b697
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-02.ref.css
@@ -0,0 +1,3 @@
+* {
+  color: rgb(0,255,0);
+}
diff --git a/tests/css/parser/declarations-invalid-03.css b/tests/css/parser/declarations-invalid-03.css
new file mode 100644
index 0000000..2a007fb
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-03.css
@@ -0,0 +1 @@
+* { color:red; color; color:green }
diff --git a/tests/css/parser/declarations-invalid-03.errors b/tests/css/parser/declarations-invalid-03.errors
new file mode 100644
index 0000000..b2b74f0
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-03.errors
@@ -0,0 +1 @@
+declarations-invalid-03.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-03.ref.css b/tests/css/parser/declarations-invalid-03.ref.css
new file mode 100644
index 0000000..272b697
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-03.ref.css
@@ -0,0 +1,3 @@
+* {
+  color: rgb(0,255,0);
+}
diff --git a/tests/css/parser/declarations-invalid-04.css b/tests/css/parser/declarations-invalid-04.css
new file mode 100644
index 0000000..5a8ee1e
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-04.css
@@ -0,0 +1 @@
+* { color:green; color: }
diff --git a/tests/css/parser/declarations-invalid-04.errors b/tests/css/parser/declarations-invalid-04.errors
new file mode 100644
index 0000000..e16010d
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-04.errors
@@ -0,0 +1 @@
+declarations-invalid-04.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-04.ref.css b/tests/css/parser/declarations-invalid-04.ref.css
new file mode 100644
index 0000000..272b697
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-04.ref.css
@@ -0,0 +1,3 @@
+* {
+  color: rgb(0,255,0);
+}
diff --git a/tests/css/parser/declarations-invalid-05.css b/tests/css/parser/declarations-invalid-05.css
new file mode 100644
index 0000000..7de3031
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-05.css
@@ -0,0 +1 @@
+* { color:red; color:; color:green }
diff --git a/tests/css/parser/declarations-invalid-05.errors b/tests/css/parser/declarations-invalid-05.errors
new file mode 100644
index 0000000..1eb9974
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-05.errors
@@ -0,0 +1 @@
+declarations-invalid-05.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-05.ref.css b/tests/css/parser/declarations-invalid-05.ref.css
new file mode 100644
index 0000000..272b697
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-05.ref.css
@@ -0,0 +1,3 @@
+* {
+  color: rgb(0,255,0);
+}
diff --git a/tests/css/parser/declarations-invalid-06.css b/tests/css/parser/declarations-invalid-06.css
new file mode 100644
index 0000000..3d3f863
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-06.css
@@ -0,0 +1 @@
+* { color:green; color{;color:maroon} }
diff --git a/tests/css/parser/declarations-invalid-06.errors b/tests/css/parser/declarations-invalid-06.errors
new file mode 100644
index 0000000..bc97576
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-06.errors
@@ -0,0 +1 @@
+declarations-invalid-06.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-06.ref.css b/tests/css/parser/declarations-invalid-06.ref.css
new file mode 100644
index 0000000..272b697
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-06.ref.css
@@ -0,0 +1,3 @@
+* {
+  color: rgb(0,255,0);
+}
diff --git a/tests/css/parser/declarations-invalid-07.css b/tests/css/parser/declarations-invalid-07.css
new file mode 100644
index 0000000..3abf590
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-07.css
@@ -0,0 +1 @@
+* { color:red; color{;color:maroon}; color:green }
diff --git a/tests/css/parser/declarations-invalid-07.errors b/tests/css/parser/declarations-invalid-07.errors
new file mode 100644
index 0000000..73f5e0e
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-07.errors
@@ -0,0 +1 @@
+declarations-invalid-07.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-07.ref.css b/tests/css/parser/declarations-invalid-07.ref.css
new file mode 100644
index 0000000..272b697
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-07.ref.css
@@ -0,0 +1,3 @@
+* {
+  color: rgb(0,255,0);
+}
diff --git a/tests/css/parser/declarations-invalid-08.css b/tests/css/parser/declarations-invalid-08.css
new file mode 100644
index 0000000..e7d9860
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-08.css
@@ -0,0 +1 @@
+* { content: 'Hello
diff --git a/tests/css/parser/declarations-invalid-08.errors b/tests/css/parser/declarations-invalid-08.errors
new file mode 100644
index 0000000..e97a2d5
--- /dev/null
+++ b/tests/css/parser/declarations-invalid-08.errors
@@ -0,0 +1,3 @@
+declarations-invalid-08.css:1: error: GTK_CSS_PROVIDER_ERROR_NAME
+declarations-invalid-08.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
+declarations-invalid-08.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-invalid-08.ref.css b/tests/css/parser/declarations-invalid-08.ref.css
new file mode 100644
index 0000000..e69de29
diff --git a/tests/css/parser/declarations-valid-01.css b/tests/css/parser/declarations-valid-01.css
new file mode 100644
index 0000000..611907d
--- /dev/null
+++ b/tests/css/parser/declarations-valid-01.css
@@ -0,0 +1 @@
+* {}
diff --git a/tests/css/parser/declarations-valid-01.ref.css b/tests/css/parser/declarations-valid-01.ref.css
new file mode 100644
index 0000000..e69de29
diff --git a/tests/css/parser/declarations-valid-02.css b/tests/css/parser/declarations-valid-02.css
new file mode 100644
index 0000000..4cf729c
--- /dev/null
+++ b/tests/css/parser/declarations-valid-02.css
@@ -0,0 +1 @@
+* { font: Sans 15 }
diff --git a/tests/css/parser/declarations-valid-02.ref.css b/tests/css/parser/declarations-valid-02.ref.css
new file mode 100644
index 0000000..3f5a75a
--- /dev/null
+++ b/tests/css/parser/declarations-valid-02.ref.css
@@ -0,0 +1,7 @@
+* {
+  font-family: "Sans";
+  font-size: 15;
+  font-style: normal;
+  font-variant: normal;
+  font-weight: normal;
+}
diff --git a/tests/css/parser/declarations-valid-03.css b/tests/css/parser/declarations-valid-03.css
new file mode 100644
index 0000000..6d85fa8
--- /dev/null
+++ b/tests/css/parser/declarations-valid-03.css
@@ -0,0 +1 @@
+* { font: Sans 15; }
diff --git a/tests/css/parser/declarations-valid-03.ref.css b/tests/css/parser/declarations-valid-03.ref.css
new file mode 100644
index 0000000..3f5a75a
--- /dev/null
+++ b/tests/css/parser/declarations-valid-03.ref.css
@@ -0,0 +1,7 @@
+* {
+  font-family: "Sans";
+  font-size: 15;
+  font-style: normal;
+  font-variant: normal;
+  font-weight: normal;
+}
diff --git a/tests/css/parser/declarations-valid-04.css b/tests/css/parser/declarations-valid-04.css
new file mode 100644
index 0000000..41852c6
--- /dev/null
+++ b/tests/css/parser/declarations-valid-04.css
@@ -0,0 +1 @@
+* { font: bold }
diff --git a/tests/css/parser/declarations-valid-04.ref.css b/tests/css/parser/declarations-valid-04.ref.css
new file mode 100644
index 0000000..805d477
--- /dev/null
+++ b/tests/css/parser/declarations-valid-04.ref.css
@@ -0,0 +1,7 @@
+* {
+  font-family: "Sans";
+  font-size: 10;
+  font-style: normal;
+  font-variant: normal;
+  font-weight: bold;
+}
diff --git a/tests/css/parser/declarations-valid-05.css b/tests/css/parser/declarations-valid-05.css
new file mode 100644
index 0000000..c3997d3
--- /dev/null
+++ b/tests/css/parser/declarations-valid-05.css
@@ -0,0 +1 @@
+* { color: red }
diff --git a/tests/css/parser/declarations-valid-05.ref.css b/tests/css/parser/declarations-valid-05.ref.css
new file mode 100644
index 0000000..55b9031
--- /dev/null
+++ b/tests/css/parser/declarations-valid-05.ref.css
@@ -0,0 +1,3 @@
+* {
+  color: rgb(255,0,0);
+}
diff --git a/tests/css/parser/declarations-valid-06.css b/tests/css/parser/declarations-valid-06.css
new file mode 100644
index 0000000..3bc5c6d
--- /dev/null
+++ b/tests/css/parser/declarations-valid-06.css
@@ -0,0 +1 @@
+* { /* just a comment */ }
diff --git a/tests/css/parser/declarations-valid-06.ref.css b/tests/css/parser/declarations-valid-06.ref.css
new file mode 100644
index 0000000..e69de29
diff --git a/tests/css/parser/declarations-valid-07.css b/tests/css/parser/declarations-valid-07.css
new file mode 100644
index 0000000..d91593c
--- /dev/null
+++ b/tests/css/parser/declarations-valid-07.css
@@ -0,0 +1,3 @@
+* { /* multi
+line
+comment */ }
diff --git a/tests/css/parser/declarations-valid-07.ref.css b/tests/css/parser/declarations-valid-07.ref.css
new file mode 100644
index 0000000..e69de29
diff --git a/tests/css/parser/declarations-valid-08.css b/tests/css/parser/declarations-valid-08.css
new file mode 100644
index 0000000..58a4c07
--- /dev/null
+++ b/tests/css/parser/declarations-valid-08.css
@@ -0,0 +1 @@
+* { font: /* comment here */ Sans 15 }
diff --git a/tests/css/parser/declarations-valid-08.ref.css b/tests/css/parser/declarations-valid-08.ref.css
new file mode 100644
index 0000000..3f5a75a
--- /dev/null
+++ b/tests/css/parser/declarations-valid-08.ref.css
@@ -0,0 +1,7 @@
+* {
+  font-family: "Sans";
+  font-size: 15;
+  font-style: normal;
+  font-variant: normal;
+  font-weight: normal;
+}
diff --git a/tests/css/parser/declarations-valid-09.css b/tests/css/parser/declarations-valid-09.css
new file mode 100644
index 0000000..88530f0
--- /dev/null
+++ b/tests/css/parser/declarations-valid-09.css
@@ -0,0 +1 @@
+* { color: red; background-color: shade (@bg_color, 0.5) }
diff --git a/tests/css/parser/declarations-valid-09.ref.css b/tests/css/parser/declarations-valid-09.ref.css
new file mode 100644
index 0000000..48d9070
--- /dev/null
+++ b/tests/css/parser/declarations-valid-09.ref.css
@@ -0,0 +1,4 @@
+* {
+  background-color: shade (@bg_color, 0.5);
+  color: rgb(255,0,0);
+}
diff --git a/tests/css/parser/declarations-valid-10.css b/tests/css/parser/declarations-valid-10.css
new file mode 100644
index 0000000..9591970
--- /dev/null
+++ b/tests/css/parser/declarations-valid-10.css
@@ -0,0 +1 @@
+* { margin: 5 }
diff --git a/tests/css/parser/declarations-valid-10.ref.css b/tests/css/parser/declarations-valid-10.ref.css
new file mode 100644
index 0000000..d0fdbf0
--- /dev/null
+++ b/tests/css/parser/declarations-valid-10.ref.css
@@ -0,0 +1,6 @@
+* {
+  margin-bottom: 5;
+  margin-left: 5;
+  margin-right: 5;
+  margin-top: 5;
+}
diff --git a/tests/css/parser/declarations-valid-11.css b/tests/css/parser/declarations-valid-11.css
new file mode 100644
index 0000000..4eb9973
--- /dev/null
+++ b/tests/css/parser/declarations-valid-11.css
@@ -0,0 +1 @@
+* { margin: 5 10 }
diff --git a/tests/css/parser/declarations-valid-11.ref.css b/tests/css/parser/declarations-valid-11.ref.css
new file mode 100644
index 0000000..83ce35b
--- /dev/null
+++ b/tests/css/parser/declarations-valid-11.ref.css
@@ -0,0 +1,6 @@
+* {
+  margin-bottom: 5;
+  margin-left: 10;
+  margin-right: 10;
+  margin-top: 5;
+}
diff --git a/tests/css/parser/declarations-valid-12.css b/tests/css/parser/declarations-valid-12.css
new file mode 100644
index 0000000..022ae30
--- /dev/null
+++ b/tests/css/parser/declarations-valid-12.css
@@ -0,0 +1 @@
+* { margin: 5 10 3 }
diff --git a/tests/css/parser/declarations-valid-12.ref.css b/tests/css/parser/declarations-valid-12.ref.css
new file mode 100644
index 0000000..daafbf9
--- /dev/null
+++ b/tests/css/parser/declarations-valid-12.ref.css
@@ -0,0 +1,6 @@
+* {
+  margin-bottom: 3;
+  margin-left: 10;
+  margin-right: 10;
+  margin-top: 5;
+}
diff --git a/tests/css/parser/declarations-valid-13.css b/tests/css/parser/declarations-valid-13.css
new file mode 100644
index 0000000..252547f
--- /dev/null
+++ b/tests/css/parser/declarations-valid-13.css
@@ -0,0 +1 @@
+* { margin: 5 10 3 5 }
diff --git a/tests/css/parser/declarations-valid-13.ref.css b/tests/css/parser/declarations-valid-13.ref.css
new file mode 100644
index 0000000..481a2dd
--- /dev/null
+++ b/tests/css/parser/declarations-valid-13.ref.css
@@ -0,0 +1,6 @@
+* {
+  margin-bottom: 3;
+  margin-left: 5;
+  margin-right: 10;
+  margin-top: 5;
+}
diff --git a/tests/css/parser/declarations-valid-14.css b/tests/css/parser/declarations-valid-14.css
new file mode 100644
index 0000000..226e3af
--- /dev/null
+++ b/tests/css/parser/declarations-valid-14.css
@@ -0,0 +1 @@
+* { padding: 5 }
diff --git a/tests/css/parser/declarations-valid-14.ref.css b/tests/css/parser/declarations-valid-14.ref.css
new file mode 100644
index 0000000..28b5f81
--- /dev/null
+++ b/tests/css/parser/declarations-valid-14.ref.css
@@ -0,0 +1,6 @@
+* {
+  padding-bottom: 5;
+  padding-left: 5;
+  padding-right: 5;
+  padding-top: 5;
+}
diff --git a/tests/css/parser/declarations-valid-15.css b/tests/css/parser/declarations-valid-15.css
new file mode 100644
index 0000000..b2c3cde
--- /dev/null
+++ b/tests/css/parser/declarations-valid-15.css
@@ -0,0 +1 @@
+* { padding: 5 10 }
diff --git a/tests/css/parser/declarations-valid-15.ref.css b/tests/css/parser/declarations-valid-15.ref.css
new file mode 100644
index 0000000..a6aa976
--- /dev/null
+++ b/tests/css/parser/declarations-valid-15.ref.css
@@ -0,0 +1,6 @@
+* {
+  padding-bottom: 5;
+  padding-left: 10;
+  padding-right: 10;
+  padding-top: 5;
+}
diff --git a/tests/css/parser/declarations-valid-16.css b/tests/css/parser/declarations-valid-16.css
new file mode 100644
index 0000000..deff898
--- /dev/null
+++ b/tests/css/parser/declarations-valid-16.css
@@ -0,0 +1 @@
+* { border-width: 5; border-radius: 10 }
diff --git a/tests/css/parser/declarations-valid-16.ref.css b/tests/css/parser/declarations-valid-16.ref.css
new file mode 100644
index 0000000..215fde7
--- /dev/null
+++ b/tests/css/parser/declarations-valid-16.ref.css
@@ -0,0 +1,10 @@
+* {
+  border-bottom-left-radius: 10;
+  border-bottom-right-radius: 10;
+  border-bottom-width: 5;
+  border-left-width: 5;
+  border-right-width: 5;
+  border-top-left-radius: 10;
+  border-top-right-radius: 10;
+  border-top-width: 5;
+}
diff --git a/tests/css/parser/declarations-valid-17.css b/tests/css/parser/declarations-valid-17.css
new file mode 100644
index 0000000..a08963d
--- /dev/null
+++ b/tests/css/parser/declarations-valid-17.css
@@ -0,0 +1 @@
+* { border-color: #ff00ff }
diff --git a/tests/css/parser/declarations-valid-17.ref.css b/tests/css/parser/declarations-valid-17.ref.css
new file mode 100644
index 0000000..261af12
--- /dev/null
+++ b/tests/css/parser/declarations-valid-17.ref.css
@@ -0,0 +1,6 @@
+* {
+  border-bottom-color: rgb(255,0,255);
+  border-left-color: rgb(255,0,255);
+  border-right-color: rgb(255,0,255);
+  border-top-color: rgb(255,0,255);
+}
diff --git a/tests/css/parser/declarations-valid-18.css b/tests/css/parser/declarations-valid-18.css
new file mode 100644
index 0000000..8b4b092
--- /dev/null
+++ b/tests/css/parser/declarations-valid-18.css
@@ -0,0 +1 @@
+* { engine: definitelydoesnotexist }
diff --git a/tests/css/parser/declarations-valid-18.errors b/tests/css/parser/declarations-valid-18.errors
new file mode 100644
index 0000000..9b00258
--- /dev/null
+++ b/tests/css/parser/declarations-valid-18.errors
@@ -0,0 +1 @@
+declarations-valid-18.css:1: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/declarations-valid-18.ref.css b/tests/css/parser/declarations-valid-18.ref.css
new file mode 100644
index 0000000..e69de29
diff --git a/tests/css/parser/declarations-valid-19.css b/tests/css/parser/declarations-valid-19.css
new file mode 100644
index 0000000..423f672
--- /dev/null
+++ b/tests/css/parser/declarations-valid-19.css
@@ -0,0 +1,3 @@
+* { background-image: -gtk-gradient (linear,               
+                                    left top, right top,   
+                                    from (#fff), to (#000)) }
diff --git a/tests/css/parser/declarations-valid-19.ref.css b/tests/css/parser/declarations-valid-19.ref.css
new file mode 100644
index 0000000..a95b753
--- /dev/null
+++ b/tests/css/parser/declarations-valid-19.ref.css
@@ -0,0 +1,3 @@
+* {
+  background-image: -gtk-gradient (linear, left top, right top, from (rgb(255,255,255)), to (rgb(0,0,0)));
+}
diff --git a/tests/css/parser/declarations-valid-20.css b/tests/css/parser/declarations-valid-20.css
new file mode 100644
index 0000000..1095225
--- /dev/null
+++ b/tests/css/parser/declarations-valid-20.css
@@ -0,0 +1,5 @@
+* { background-image: -gtk-gradient (linear,               
+                                    0.0 0.5, 0.5 1.0,      
+                                    from (#fff),           
+                                    color-stop (0.5, #f00),
+                                    to (#000))              }
diff --git a/tests/css/parser/declarations-valid-20.ref.css b/tests/css/parser/declarations-valid-20.ref.css
new file mode 100644
index 0000000..d9d6c17
--- /dev/null
+++ b/tests/css/parser/declarations-valid-20.ref.css
@@ -0,0 +1,3 @@
+* {
+  background-image: -gtk-gradient (linear, left center, center bottom, from (rgb(255,255,255)), color-stop (0.5, rgb(255,0,0)), to (rgb(0,0,0)));
+}
diff --git a/tests/css/parser/declarations-valid-21.css b/tests/css/parser/declarations-valid-21.css
new file mode 100644
index 0000000..8986615
--- /dev/null
+++ b/tests/css/parser/declarations-valid-21.css
@@ -0,0 +1,6 @@
+* { background-image: -gtk-gradient (radial,               
+                                     center center, 0.25,   
+                                     center center, 0.75,   
+                                     color-stop (0.0,#fff),
+                                     color-stop (1.0,#000))}
+
diff --git a/tests/css/parser/declarations-valid-21.ref.css b/tests/css/parser/declarations-valid-21.ref.css
new file mode 100644
index 0000000..4495fa6
--- /dev/null
+++ b/tests/css/parser/declarations-valid-21.ref.css
@@ -0,0 +1,3 @@
+* {
+  background-image: -gtk-gradient (radial, center center, 0.25, center center, 0.75, from (rgb(255,255,255)), to (rgb(0,0,0)));
+}
diff --git a/tests/css/parser/declarations-valid-22.css b/tests/css/parser/declarations-valid-22.css
new file mode 100644
index 0000000..dff2506
--- /dev/null
+++ b/tests/css/parser/declarations-valid-22.css
@@ -0,0 +1 @@
+* { border-image: url("./test.png") 3 4 3 4 stretch       }
diff --git a/tests/css/parser/declarations-valid-22.ref.css b/tests/css/parser/declarations-valid-22.ref.css
new file mode 100644
index 0000000..b853db8
--- /dev/null
+++ b/tests/css/parser/declarations-valid-22.ref.css
@@ -0,0 +1,6 @@
+* {
+  border-image-repeat: stretch;
+  border-image-slice: 3 4;
+  border-image-source: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAABmJLR0QA/wD/AP+gvaeTAAAAFUlEQVQImQXBAQEAAACAEP9PF1CpMCnkBftPnd1xAAAAAElFTkSuQmCC");
+  border-image-width: none;
+}
diff --git a/tests/css/parser/declarations-valid-23.css b/tests/css/parser/declarations-valid-23.css
new file mode 100644
index 0000000..1cbeeb9
--- /dev/null
+++ b/tests/css/parser/declarations-valid-23.css
@@ -0,0 +1 @@
+* { border-image: url("./test.png") 3 4 3 4 repeat stretch}
diff --git a/tests/css/parser/declarations-valid-23.ref.css b/tests/css/parser/declarations-valid-23.ref.css
new file mode 100644
index 0000000..7eb45bc
--- /dev/null
+++ b/tests/css/parser/declarations-valid-23.ref.css
@@ -0,0 +1,6 @@
+* {
+  border-image-repeat: repeat stretch;
+  border-image-slice: 3 4;
+  border-image-source: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAABmJLR0QA/wD/AP+gvaeTAAAAFUlEQVQImQXBAQEAAACAEP9PF1CpMCnkBftPnd1xAAAAAElFTkSuQmCC");
+  border-image-width: none;
+}
diff --git a/tests/css/parser/declarations-valid-24.css b/tests/css/parser/declarations-valid-24.css
new file mode 100644
index 0000000..cb1794a
--- /dev/null
+++ b/tests/css/parser/declarations-valid-24.css
@@ -0,0 +1 @@
+* { transition: 150ms ease-in-out                          }
diff --git a/tests/css/parser/declarations-valid-24.ref.css b/tests/css/parser/declarations-valid-24.ref.css
new file mode 100644
index 0000000..0dd35d6
--- /dev/null
+++ b/tests/css/parser/declarations-valid-24.ref.css
@@ -0,0 +1,3 @@
+* {
+  transition: 150ms ease-in-out;
+}
diff --git a/tests/css/parser/declarations-valid-25.css b/tests/css/parser/declarations-valid-25.css
new file mode 100644
index 0000000..957cc63
--- /dev/null
+++ b/tests/css/parser/declarations-valid-25.css
@@ -0,0 +1 @@
+* { transition: 1s linear loop                             }
diff --git a/tests/css/parser/declarations-valid-25.ref.css b/tests/css/parser/declarations-valid-25.ref.css
new file mode 100644
index 0000000..502fa01
--- /dev/null
+++ b/tests/css/parser/declarations-valid-25.ref.css
@@ -0,0 +1,3 @@
+* {
+  transition: 1s linear loop;
+}
diff --git a/tests/css/parser/test.png b/tests/css/parser/test.png
new file mode 100644
index 0000000..7f48e1a
Binary files /dev/null and b/tests/css/parser/test.png differ



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