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