2008-09-02 14:05:49 -04:00
|
|
|
USING: html.streams html.streams.private accessors io
|
|
|
|
io.streams.string io.styles kernel namespaces tools.test
|
|
|
|
xml.writer sbufs sequences inspector colors ;
|
2008-05-23 18:33:31 -04:00
|
|
|
IN: html.streams.tests
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2007-09-25 20:30:33 -04:00
|
|
|
: make-html-string
|
2008-09-29 05:09:02 -04:00
|
|
|
[ with-html-writer ] with-string-writer ; inline
|
2008-04-14 07:04:01 -04:00
|
|
|
|
|
|
|
[ [ ] make-html-string ] must-infer
|
2007-09-25 20:30:33 -04:00
|
|
|
|
|
|
|
[ ] [
|
|
|
|
512 <sbuf> <html-stream> drop
|
2007-09-20 18:09:08 -04:00
|
|
|
] unit-test
|
|
|
|
|
2007-09-25 20:30:33 -04:00
|
|
|
[ "" ] [
|
|
|
|
[ "" write ] make-html-string
|
|
|
|
] unit-test
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2007-09-25 20:30:33 -04:00
|
|
|
[ "a" ] [
|
|
|
|
[ CHAR: a write1 ] make-html-string
|
2007-09-20 18:09:08 -04:00
|
|
|
] unit-test
|
|
|
|
|
2007-09-25 20:30:33 -04:00
|
|
|
[ "<" ] [
|
|
|
|
[ "<" write ] make-html-string
|
|
|
|
] unit-test
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2007-09-25 20:30:33 -04:00
|
|
|
[ "<" ] [
|
2008-05-05 03:19:25 -04:00
|
|
|
[ "<" H{ } output-stream get format-html-span ] make-html-string
|
2007-09-25 20:30:33 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
TUPLE: funky town ;
|
|
|
|
|
|
|
|
M: funky browser-link-href
|
2008-09-02 14:05:49 -04:00
|
|
|
"http://www.funky-town.com/" swap town>> append ;
|
2007-09-25 20:30:33 -04:00
|
|
|
|
|
|
|
[ "<a href='http://www.funky-town.com/austin'><</a>" ] [
|
|
|
|
[
|
2008-04-13 16:06:27 -04:00
|
|
|
"<" "austin" funky boa write-object
|
2007-09-25 20:30:33 -04:00
|
|
|
] make-html-string
|
2007-09-20 18:09:08 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ "<span style='font-family: monospace; '>car</span>" ]
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"car"
|
|
|
|
H{ { font "monospace" } }
|
2007-09-25 20:30:33 -04:00
|
|
|
format
|
|
|
|
] make-html-string
|
2007-09-20 18:09:08 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ "<span style='color: #ff00ff; '>car</span>" ]
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"car"
|
2008-08-04 12:02:17 -04:00
|
|
|
H{ { foreground T{ rgba f 1 0 1 1 } } }
|
2007-09-25 20:30:33 -04:00
|
|
|
format
|
|
|
|
] make-html-string
|
|
|
|
] unit-test
|
|
|
|
|
2008-01-11 01:01:23 -05:00
|
|
|
[ "<div style='background-color: #ff00ff; white-space: pre; font-family: monospace; '>cdr</div>" ]
|
2007-09-25 20:30:33 -04:00
|
|
|
[
|
|
|
|
[
|
2008-08-04 12:02:17 -04:00
|
|
|
H{ { page-color T{ rgba f 1 0 1 1 } } }
|
2007-09-25 20:30:33 -04:00
|
|
|
[ "cdr" write ] with-nesting
|
|
|
|
] make-html-string
|
2007-09-20 18:09:08 -04:00
|
|
|
] unit-test
|
2008-01-11 01:01:23 -05:00
|
|
|
|
|
|
|
[
|
|
|
|
"<div style='white-space: pre; font-family: monospace; '></div>"
|
|
|
|
] [
|
|
|
|
[ H{ } [ ] with-nesting nl ] make-html-string
|
|
|
|
] unit-test
|
2008-05-23 23:20:27 -04:00
|
|
|
|
2008-09-29 05:09:02 -04:00
|
|
|
[ ] [ [ { 1 2 3 } describe ] with-html-writer ] unit-test
|