class test plain text
import ideal • machine • channels • string writer
static FOO : "foo" !> base string
static BAR : "bar" !> base string
static BAZ : "baz" !> base string
static WYZZY : "wyzzy" !> base string
testcase test writer trivial()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write(base element • make(text library • P, FOO))
assert "foo\n" == the writer • elements()
testcase test writer indent0()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write(base element • make(text library • P, FOO))
the formatter • write(base element • make(text library • INDENT, BAR))
assert "foo\n bar\n" == the writer • elements()
testcase test writer indent1()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write(base element • make(text library • P, FOO))
the formatter • write(base element • make(text library • INDENT, base list text node • make(bar, baz)))
the formatter • write(base element • make(text library • P, WYZZY))
assert "foo\n bar\n baz\nwyzzy\n" == the writer • elements()
testcase test writer indent2()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write(base element • make(text library • P, FOO))
the formatter • write(base element • make(text library • INDENT, "bar\nbaz" !> base string))
the formatter • write(base element • make(text library • P, WYZZY))
assert "foo\n bar\n baz\nwyzzy\n" == the writer • elements()
testcase test self closing tag()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write(FOO)
the formatter • write(base element • make(text library • BR, text library • CLEAR, "all" !> base string, missing • instance))
the formatter • write("bar\n" !> base string)
assert "foo\nbar\n" == the writer • elements()
testcase test writer fragment()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
fragment : text entity • new(text library • IDEAL TEXT, "*", "middot")
the formatter • write("one" !> base string)
the formatter • write(fragment)
the formatter • write("two" !> base string)
assert "one*two" == the writer • elements()
testcase test underline tag()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write("hello " !> base string)
world string : "world" !> base string
br : base element • make(text library • BR, missing • instance)
the formatter • write(base element • make(text library • U, base list text node • make(world string, br, FOO)))
the formatter • write(" bar" !> base string)
the formatter • write(base element • make(text library • BR, missing • instance))
assert "hello world\n ^^^^^\nfoo bar\n^^^\n" == the writer • elements()
testcase test underline2 tag()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write("hello " !> base string)
world string : "world" !> base string
br : base element • make(text library • BR, missing • instance)
the formatter • write(base element • make(text library • U2, base list text node • make(world string, br, FOO)))
the formatter • write(" bar" !> base string)
the formatter • write(base element • make(text library • BR, missing • instance))
assert "hello world\n -----\nfoo bar\n---\n" == the writer • elements()
testcase test two underlines()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write(text util • join("foo " !> base string, mid, " bar" !> base string))
the formatter • write(base element • make(text library • BR, missing • instance))
assert "foo start hi end bar\n ------^^----\n" == the writer • elements()
testcase test blank line()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatter • write(base element • make(text library • DIV, FOO))
the formatter • write(base element • new(text library • BR))
the formatter • write(base element • make(text library • DIV, "bar" !> base string))
assert "foo\n\nbar\n" == the writer • elements()