1 USING: html.parser kernel tools.test ;
5 V{ T{ tag f "html" H{ } f f } }
6 ] [ "<html>" parse-html ] unit-test
9 V{ T{ tag f "html" H{ } f t } }
10 ] [ "</html>" parse-html ] unit-test
13 V{ T{ tag f "a" H{ { "href" "http://factorcode.org/" } } f f } }
14 ] [ "<a href=\"http://factorcode.org/\">" parse-html ] unit-test
17 V{ T{ tag f "a" H{ { "href" "http://factorcode.org/" } } f f } }
18 ] [ "<a href = \"http://factorcode.org/\" >" parse-html ] unit-test
26 H{ { "baz" "\"quux\"" } { "foo" "bar's" } }
31 ] [ "<a foo=\"bar's\" baz='\"quux\"' >" parse-html ] unit-test
39 { "href" "http://factorcode.org/" }
43 ] [ "<a href = \"http://factorcode.org/\" foo = bar baz='quux'a=pirsqd >" parse-html ] unit-test
47 T{ tag f "html" H{ } f f }
48 T{ tag f "head" H{ } f f }
49 T{ tag f "head" H{ } f t }
50 T{ tag f "html" H{ } f t }
52 ] [ "<html<head</head</html" parse-html ] unit-test
56 T{ tag f "head" H{ } f f }
57 T{ tag f "title" H{ } f f }
58 T{ tag f text f "Spagna" f }
59 T{ tag f "title" H{ } f t }
60 T{ tag f "head" H{ } f t }
62 ] [ "<head<title>Spagna</title></head" parse-html ] unit-test