test suite test plain text
import idealmachinechannelsstring writer
static FOO : "foo"
static BAR : "bar"
static BAZ : "baz"
static WYZZY : "wyzzy"
test case test writer trivial()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(base element • new(text libraryP, FOO))
assert "foo\n" == the writerelements()
test case test writer indent0()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(base element • new(text libraryP, FOO))
the formatterwrite(base element • new(text libraryINDENT, BAR))
assert "foo\n bar\n" == the writerelements()
test case test writer indent1()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(base element • new(text libraryP, FOO))
bar : base element • new(text libraryP, BAR)
baz : base element • new(text libraryP, BAZ)
the formatterwrite(base element • new(text libraryINDENT, base list text nodemake(bar, baz)))
the formatterwrite(base element • new(text libraryP, WYZZY))
assert "foo\n bar\n baz\nwyzzy\n" == the writerelements()
test case test writer indent2()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(base element • new(text libraryP, FOO))
the formatterwrite(base element • new(text libraryINDENT, "bar\nbaz"))
the formatterwrite(base element • new(text libraryP, WYZZY))
assert "foo\n bar\n baz\nwyzzy\n" == the writerelements()
test case test self closing tag()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(FOO)
the formatterwrite(base element • new(text libraryBR, text libraryCLEAR, "all", missinginstance))
the formatterwrite("bar\n")
assert "foo\nbar\n" == the writerelements()
test case test writer fragment()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
fragment : text entity • new(text libraryIDEAL TEXT, "*", "middot")
the formatterwrite("one")
the formatterwrite(fragment)
the formatterwrite("two")
assert "one*two" == the writerelements()
test case test underline tag()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite("hello ")
world string : "world"
the formatterwrite(base element • new(text libraryU, base list text nodemake(world string, br, FOO)))
the formatterwrite(" bar")
the formatterwrite(base element • new(text libraryBR, missinginstance))
assert "hello world\n ^^^^^\nfoo bar\n^^^\n" == the writerelements()
test case test underline2 tag()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite("hello ")
world string : "world"
the formatterwrite(base element • new(text libraryU2, base list text nodemake(world string, br, FOO)))
the formatterwrite(" bar")
the formatterwrite(base element • new(text libraryBR, missinginstance))
assert "hello world\n -----\nfoo bar\n---\n" == the writerelements()
test case test two underlines()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
text element hi : base element • new(text libraryU, "hi")
the formatterwrite(text utilitiesjoin("foo ", mid, " bar"))
the formatterwrite(base element • new(text libraryBR, missinginstance))
assert "foo start hi end bar\n ------^^----\n" == the writerelements()
test case test blank line()
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(base element • new(text libraryDIV, FOO))
the formatterwrite(base element • new(text libraryBR))
the formatterwrite(base element • new(text libraryDIV, "bar"))
assert "foo\n\nbar\n" == the writerelements()