]> gitweb.factorcode.org Git - factor.git/blob - extra/xml/tests/errors.factor
More unit test fixes
[factor.git] / extra / xml / tests / errors.factor
1 USING: continuations xml xml.errors tools.test kernel arrays xml.data state-parser quotations ;
2 IN: xml.tests
3
4 : xml-error-test ( expected-error xml-string -- )
5     [ string>xml ] curry swap [ = ] curry must-fail-with ;
6
7 T{ no-entity T{ parsing-error f 1 10 } "nbsp" } "<x>&nbsp;</x>" xml-error-test
8 T{ mismatched T{ parsing-error f 1 8 } T{ name f "" "x" "" } T{ name f "" "y" "" }
9 } "<x></y>" xml-error-test
10 T{ unclosed f V{ T{ name f "" "x" "" } } } "<x>" xml-error-test
11 T{ nonexist-ns T{ parsing-error f 1 5 } "x" } "<x:y/>" xml-error-test
12 T{ unopened T{ parsing-error f 1 5 } } "</x>" xml-error-test
13 T{ not-yes/no T{ parsing-error f 1 41 } "maybe" } "<?xml version='1.0' standalone='maybe'?><x/>" xml-error-test
14 T{ extra-attrs T{ parsing-error f 1 32 } V{ T{ name f "" "foo" f } }
15 } "<?xml version='1.1' foo='bar'?><x/>" xml-error-test
16 T{ bad-version T{ parsing-error f 1 28 } "5 million" } "<?xml version='5 million'?><x/>" xml-error-test
17 T{ notags f } "" xml-error-test
18 T{ multitags f } "<x/><y/>" xml-error-test
19 T{ bad-prolog T{ parsing-error f 1 26 } T{ prolog f "1.0" "iso-8859-1" f }
20 } "<x/><?xml version='1.0'?>" xml-error-test
21 T{ capitalized-prolog T{ parsing-error f 1 6 } "XmL" } "<?XmL version='1.0'?><x/>"
22 xml-error-test
23 T{ pre/post-content f "x" t } "x<y/>" xml-error-test
24 T{ versionless-prolog T{ parsing-error f 1 8 } } "<?xml?><x/>" xml-error-test
25 T{ bad-instruction T{ parsing-error f 1 11 } T{ instruction f "xsl" }
26 } "<x><?xsl?></x>" xml-error-test
27 T{ bad-directive T{ parsing-error f 1 15 } T{ directive f "DOCTYPE" }
28 } "<x/><!DOCTYPE>" xml-error-test