html.parser.printer: unit tests
parent
aef2e02c0b
commit
00f82ae5f0
|
@ -0,0 +1,33 @@
|
||||||
|
USING:
|
||||||
|
html.parser html.parser.printer
|
||||||
|
io.streams.string
|
||||||
|
namespaces
|
||||||
|
tools.test ;
|
||||||
|
IN: html.parser.printer.tests
|
||||||
|
|
||||||
|
[
|
||||||
|
" "
|
||||||
|
] [
|
||||||
|
[ 5 #indentations set 2 tab-width set tabs ] with-scope
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
" rel='nofollow' href='http://www.google.com'"
|
||||||
|
] [
|
||||||
|
H{ { "href" "http://www.google.com" } { "rel" "nofollow" } }
|
||||||
|
[ print-attributes ] with-string-writer
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
"<p>\n Sup dude!\n <br>\n</p>\n"
|
||||||
|
] [
|
||||||
|
"<p>Sup dude!<br></p>" parse-html [ prettyprint-html ] with-string-writer
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
! Wrongly nested tags
|
||||||
|
[
|
||||||
|
"<div>\n <p>\n Sup dude!\n <br>\n </div>\n</p>\n"
|
||||||
|
] [
|
||||||
|
"<div><p>Sup dude!<br></div></p>" parse-html
|
||||||
|
[ prettyprint-html ] with-string-writer
|
||||||
|
] unit-test
|
Loading…
Reference in New Issue