factor/contrib/httpd/test/html.factor

64 lines
1.2 KiB
Factor
Raw Normal View History

IN: temporary
2005-07-13 15:34:38 -04:00
USING: html io kernel namespaces styles test ;
2004-07-16 02:26:21 -04:00
[
"<html>&'sgml'"
2004-08-04 03:12:55 -04:00
] [ "<html>&'sgml'" chars>entities ] unit-test
2004-07-16 02:26:21 -04:00
[ "/foo/bar" ]
2004-08-30 20:24:19 -04:00
[
[
"/home/slava/doc/" "doc-root" set
"/home/slava/doc/foo/bar" file-link-href
] with-scope
] unit-test
[ "" ]
[
[
[ ] [ drop ] span-tag
] string-out
] unit-test
[ "<span style='color: #ff00ff; font-family: Monospaced; '>car</span>" ]
[
[
[ [ foreground 1 0 1 ] [[ font "Monospaced" ]] ]
[ drop "car" write ]
span-tag
] string-out
] unit-test
: html-format ( string style -- string )
[ format ] with-html-stream ;
2004-11-28 21:56:58 -05:00
[ "hello world" ]
[
[ "hello world" [ ] html-format ] string-out
] unit-test
[ "<span style='color: #ff00ff; font-family: Monospaced; '>car</span>" ]
[
[
"car"
[ [ foreground 1 0 1 ] [[ font "Monospaced" ]] ]
html-format
] string-out
] unit-test
[
"<html><head><title>Foo</title></head><body><h1>Foo</h1></body></html>"
] [
[
"Foo" [ ] html-document
] string-out
] unit-test
[
"<html><head><title>Foo</title></head><body><h1>Foo</h1><pre>Hi</pre></body></html>"
] [
[
"Foo" [ "Hi" write ] simple-html-document
] string-out
] unit-test