From 3f07482b10a08870459e318578b9f4080defd75f Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 14 Apr 2011 17:44:31 +0200 Subject: [PATCH] tests: Add parsing test from the css spec --- tests/css/parser/Makefile.am | 3 +++ .../parser/css-21-malformed-declarations.css | 7 +++++ .../css-21-malformed-declarations.errors | 6 +++++ .../css-21-malformed-declarations.ref.css | 27 +++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 tests/css/parser/css-21-malformed-declarations.css create mode 100644 tests/css/parser/css-21-malformed-declarations.errors create mode 100644 tests/css/parser/css-21-malformed-declarations.ref.css diff --git a/tests/css/parser/Makefile.am b/tests/css/parser/Makefile.am index 62f739fac5..75cc6ccbda 100644 --- a/tests/css/parser/Makefile.am +++ b/tests/css/parser/Makefile.am @@ -34,6 +34,9 @@ EXTRA_DIST += \ close-at-end-of-file.css \ close-at-end-of-file.errors \ close-at-end-of-file.ref.css \ + css-21-malformed-declarations.css \ + css-21-malformed-declarations.errors \ + css-21-malformed-declarations.ref.css \ declarations.css \ declarations.errors \ declarations.ref.css \ diff --git a/tests/css/parser/css-21-malformed-declarations.css b/tests/css/parser/css-21-malformed-declarations.css new file mode 100644 index 0000000000..7ea0cc6b6e --- /dev/null +++ b/tests/css/parser/css-21-malformed-declarations.css @@ -0,0 +1,7 @@ +p { color:green } +p { color:green; color } /* malformed declaration missing ':', value */ +p { color:red; color; color:green } /* same with expected recovery */ +p { color:green; color: } /* malformed declaration missing value */ +p { color:red; color:; color:green } /* same with expected recovery */ +p { color:green; color{;color:maroon} } /* unexpected tokens { } */ +p { color:red; color{;color:maroon}; color:green } /* same with recovery */ diff --git a/tests/css/parser/css-21-malformed-declarations.errors b/tests/css/parser/css-21-malformed-declarations.errors new file mode 100644 index 0000000000..abff163335 --- /dev/null +++ b/tests/css/parser/css-21-malformed-declarations.errors @@ -0,0 +1,6 @@ +css-21-malformed-declarations.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX +css-21-malformed-declarations.css:3: error: GTK_CSS_PROVIDER_ERROR_SYNTAX +css-21-malformed-declarations.css:4: error: GTK_CSS_PROVIDER_ERROR_SYNTAX +css-21-malformed-declarations.css:5: error: GTK_CSS_PROVIDER_ERROR_SYNTAX +css-21-malformed-declarations.css:6: error: GTK_CSS_PROVIDER_ERROR_SYNTAX +css-21-malformed-declarations.css:7: error: GTK_CSS_PROVIDER_ERROR_SYNTAX diff --git a/tests/css/parser/css-21-malformed-declarations.ref.css b/tests/css/parser/css-21-malformed-declarations.ref.css new file mode 100644 index 0000000000..b41216b0af --- /dev/null +++ b/tests/css/parser/css-21-malformed-declarations.ref.css @@ -0,0 +1,27 @@ +p { + color: rgb(0,255,0); +} + +p { + color: rgb(0,255,0); +} + +p { + color: rgb(0,255,0); +} + +p { + color: rgb(0,255,0); +} + +p { + color: rgb(0,255,0); +} + +p { + color: rgb(0,255,0); +} + +p { + color: rgb(0,255,0); +}