summaryrefslogtreecommitdiff
path: root/test/data/parse
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-14 17:31:14 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-14 17:31:14 +0000
commiteee0b5e4eae37ec56b78668c16d715c705a81a5c (patch)
tree9b82f528f8e3449488f1c35f63529c9b1a9d14a4 /test/data/parse
parentf5197dc5b96bd59b55c2731f56f713202cfe750d (diff)
downloadlibcss-eee0b5e4eae37ec56b78668c16d715c705a81a5c.tar.gz
libcss-eee0b5e4eae37ec56b78668c16d715c705a81a5c.tar.bz2
Basic tests for colour values.
svn path=/trunk/libcss/; revision=6066
Diffstat (limited to 'test/data/parse')
-rw-r--r--test/data/parse/INDEX1
-rw-r--r--test/data/parse/colours.dat76
2 files changed, 77 insertions, 0 deletions
diff --git a/test/data/parse/INDEX b/test/data/parse/INDEX
index 1ae95e9..18fb6a2 100644
--- a/test/data/parse/INDEX
+++ b/test/data/parse/INDEX
@@ -5,3 +5,4 @@
tests1.dat Basic tests
selectors.dat Selectors
atrules.dat @-rules
+colours.dat Colour values
diff --git a/test/data/parse/colours.dat b/test/data/parse/colours.dat
new file mode 100644
index 0000000..6a66205
--- /dev/null
+++ b/test/data/parse/colours.dat
@@ -0,0 +1,76 @@
+## Simple colour values
+
+##data
+#* { color: red }
+##errors
+##expected
+#| 1 *
+#| 0x0200000f 0xff000000
+##reset
+
+#data
+* { color: #f00 }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0xff000000
+#reset
+
+#data
+* { color: #ff0000 }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0xff000000
+#reset
+
+#data
+* { color: rgb(255, 0, 0) }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0xff000000
+#reset
+
+#data
+* { color: rgb(100%, 0%, 0%) }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0xff000000
+#reset
+
+## Out-of-range rgb() parameters
+
+#data
+* { color: rgb(300, 0, 0) }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0xff000000
+#reset
+
+#data
+* { color: rgb(-10, 0, 0) }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0x00000000
+#reset
+
+#data
+* { color: rgb(150%, 0%, 0%) }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0xff000000
+#reset
+
+#data
+* { color: rgb(-10%, 0%, 0%) }
+#errors
+#expected
+| 1 *
+| 0x0200000f 0x00000000
+#reset
+