summaryrefslogtreecommitdiff
path: root/test/data
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-19 00:44:21 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-19 00:44:21 +0000
commitdc1f016626194d2f73e62e6ae6c083a7c36da013 (patch)
treece60276e8337135e24a345f917dd47b4ea29f82a /test/data
parentc3053699eb33a9b29c1f98ea5473bb24a8721420 (diff)
downloadlibcss-dc1f016626194d2f73e62e6ae6c083a7c36da013.tar.gz
libcss-dc1f016626194d2f73e62e6ae6c083a7c36da013.tar.bz2
Another test harness for parser tests. This one compares the reserialised output, thus allowing us to sensibly test handling of invalid input and suchlike.
Also, some rudimentary tests using this harness, and some documentation of the test data format. This doesn't use the dumping code from the library itself, as that's likely to disappear. svn path=/trunk/libcss/; revision=6144
Diffstat (limited to 'test/data')
-rw-r--r--test/data/parse2/INDEX5
-rw-r--r--test/data/parse2/README39
-rw-r--r--test/data/parse2/tests1.dat31
3 files changed, 75 insertions, 0 deletions
diff --git a/test/data/parse2/INDEX b/test/data/parse2/INDEX
new file mode 100644
index 0000000..fb15ad4
--- /dev/null
+++ b/test/data/parse2/INDEX
@@ -0,0 +1,5 @@
+# Index file for automated parser tests
+#
+# Test Description
+
+tests1.dat Basic tests
diff --git a/test/data/parse2/README b/test/data/parse2/README
new file mode 100644
index 0000000..dec15f4
--- /dev/null
+++ b/test/data/parse2/README
@@ -0,0 +1,39 @@
+Parser testcases
+================
+
+Format
+------
+
+#data
+<css source data>
+#errors
+<list of expected errors, with line/col offsets> (ignored at present)
+#expected
+<cssom tree, as below>
+#reset
+
+Format of cssom tree
+--------------------
+
+ line ::= rule | declaration
+ rule ::= '| ' name
+ name ::= .+
+ declaration ::= '| ' property-name ': ' property-value
+
+Example
+-------
+
+#data
+* { color: #ff0000; background-image: url("foo.png"); }
+#errors
+#expected
+| *
+| color: #ff000000
+| background-image: url("foo.png")
+#reset
+
+TODO
+----
+
+ + Permit nesting of rules (for nested block support)
+
diff --git a/test/data/parse2/tests1.dat b/test/data/parse2/tests1.dat
new file mode 100644
index 0000000..6cf70d1
--- /dev/null
+++ b/test/data/parse2/tests1.dat
@@ -0,0 +1,31 @@
+#data
+* { }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { color: #ff0000 }
+#errors
+#expected
+| *
+| color: #ff000000
+#reset
+
+#data
+* { color: inherit }
+#errors
+#expected
+| *
+| color: inherit
+#reset
+
+#data
+* { background-image: url("foo.png"); color: inherit }
+#errors
+#expected
+| *
+| background-image: url('foo.png')
+| color: inherit
+#reset