1 USING: continuations xml xml.errors tools.test kernel arrays
2 xml.data quotations fry ;
5 : xml-error-test ( expected-error xml-string -- )
6 '[ _ string>xml ] swap '[ _ = ] must-fail-with ;
8 T{ no-entity f 1 10 "nbsp" } "<x> </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" }
15 "<?xml version='1.0' standalone='maybe'?><x/>" xml-error-test
16 T{ extra-attrs f 1 32 V{ T{ name f "" "foo" f } }
17 } "<?xml version='1.1' foo='bar'?><x/>" xml-error-test
18 T{ bad-version f 1 28 "5 million" }
19 "<?xml version='5 million'?><x/>" xml-error-test
20 T{ notags f } "" xml-error-test
21 T{ multitags } "<x/><y/>" xml-error-test
22 T{ bad-prolog f 1 26 T{ prolog f "1.0" "UTF-8" f } }
23 "<x/><?xml version='1.0'?>" xml-error-test
24 T{ capitalized-prolog f 1 6 "XmL" } "<?XmL version='1.0'?><x/>"
26 T{ pre/post-content f "x" t } "x<y/>" xml-error-test
27 T{ versionless-prolog f 1 8 } "<?xml?><x/>" xml-error-test
28 T{ unclosed-quote f 1 13 } "<x value='/>" xml-error-test
29 T{ bad-name f 1 3 "-" } "<-/>" xml-error-test
30 T{ quoteless-attr f 1 10 } "<x value=3/>" xml-error-test
31 T{ attr-w/< f 1 11 } "<x value='<'/>" xml-error-test
32 T{ text-w/]]> f 1 6 } "<x>]]></x>" xml-error-test
33 T{ duplicate-attr f 1 21 T{ name { space "" } { main "this" } } V{ "a" "b" } } "<x this='a' this='b'/>" xml-error-test
34 T{ bad-cdata f 1 3 } "<![CDATA[]]><x/>" xml-error-test
35 T{ bad-cdata f 1 7 } "<x/><![CDATA[]]>" xml-error-test
36 T{ pre/post-content f "&" t } "&32;<x/>" xml-error-test
37 T{ bad-doctype f 1 17 "a" } "<!DOCTYPE foo [ a ]><x/>" xml-error-test
38 T{ bad-doctype f 1 22 T{ opener { name T{ name f "" "foo" "" } } { attrs T{ attrs } } } } "<!DOCTYPE foo [ <foo> ]><x/>" xml-error-test