test suite test plain text
import ideal • machine • channels • string writer
static FOO : "foo"
static BAR : "bar"
static BAZ : "baz"
static WYZZY : "wyzzy"
test case test writer trivial()
the writer : string writer • new()
assert "foo\n" == the writer • elements()
test case test writer indent0()
the writer : string writer • new()
assert "foo\n bar\n" == the writer • elements()
test case test writer indent1()
the writer : string writer • new()
the formatter • write(base element • new(text library • INDENT, base list text node • make(bar, baz)))
assert "foo\n bar\n baz\nwyzzy\n" == the writer • elements()
test case test writer indent2()
the writer : string writer • new()
assert "foo\n bar\n baz\nwyzzy\n" == the writer • elements()
test case test self closing tag()
the writer : string writer • new()
the formatter • write(base element • new(text library • BR, text library • CLEAR, "all", missing • instance))
the formatter • write("bar\n")
assert "foo\nbar\n" == the writer • elements()
test case test writer fragment()
the writer : string writer • new()
the formatter • write("one")
the formatter • write("two")
assert "one*two" == the writer • elements()
test case test underline tag()
the writer : string writer • new()
the formatter • write("hello ")
world string : "world"
the formatter • write(base element • new(text library • U, base list text node • make(world string, br, FOO)))
the formatter • write(" bar")
assert "hello world\n ^^^^^\nfoo bar\n^^^\n" == the writer • elements()
test case test underline2 tag()
the writer : string writer • new()
the formatter • write("hello ")
world string : "world"
the formatter • write(base element • new(text library • U2, base list text node • make(world string, br, FOO)))
the formatter • write(" bar")
assert "hello world\n -----\nfoo bar\n---\n" == the writer • elements()
test case test two underlines()
the writer : string writer • new()
text element mid : base element • new(text library • U2, list dictionary[attribute id, attribute fragment] • new(), base list text node • make("start ", hi, " end"))
assert "foo start hi end bar\n ------^^----\n" == the writer • elements()
test case test blank line()
the writer : string writer • new()
assert "foo\n\nbar\n" == the writer • elements()