summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-14 11:35:34 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-14 11:35:34 +0000
commit69d3fa317a5c227f313ee76546dbc6b128faed68 (patch)
treeecbed8f79af7d94052c874eb5c0d3e7f8873dadd /test
parentbe460d4477d8955063bf834377d8e934cc507a3d (diff)
downloadlibcss-69d3fa317a5c227f313ee76546dbc6b128faed68.tar.gz
libcss-69d3fa317a5c227f313ee76546dbc6b128faed68.tar.bz2
@import tests and support in the test harness.
svn path=/trunk/libcss/; revision=6063
Diffstat (limited to 'test')
-rw-r--r--test/data/parse/atrules.dat25
-rw-r--r--test/parse-auto.c13
2 files changed, 21 insertions, 17 deletions
diff --git a/test/data/parse/atrules.dat b/test/data/parse/atrules.dat
index ebd0f89..b21fbb9 100644
--- a/test/data/parse/atrules.dat
+++ b/test/data/parse/atrules.dat
@@ -7,18 +7,17 @@
| 2 UTF-8
#reset
-##data
-#@import "foo.css";
-##errors
-##expected
-#| 3 foo.css
-##reset
-#
-##data
-#@import url("foo.css");
-##errors
-##expected
-#| 3 foo.css
-##reset
+#data
+@import "foo.css";
+#errors
+#expected
+| 3 foo.css
+#reset
+#data
+@import url("foo.css");
+#errors
+#expected
+| 3 foo.css
+#reset
diff --git a/test/parse-auto.c b/test/parse-auto.c
index b291922..cb67dee 100644
--- a/test/parse-auto.c
+++ b/test/parse-auto.c
@@ -364,10 +364,15 @@ void validate_rule_charset(css_rule_charset *s, exp_entry *e, int testnum)
void validate_rule_import(css_rule_import *s, exp_entry *e, int testnum)
{
- UNUSED(s);
- UNUSED(e);
- UNUSED(testnum);
- assert(0);
+ if (s->sheet == NULL) {
+ assert(0 && "No imported sheet");
+ }
+
+ if (strcmp(s->sheet->url, e->name) != 0) {
+ printf("%d: Got URL '%s'. Expected '%s'\n",
+ testnum, s->sheet->url, e->name);
+ assert(0 && "Mismatched URLs");
+ }
}
void dump_selector_list(css_selector *list, char **ptr)