test suite test display
import idealmachineelementsruntime util
import idealmachinechannelsstring writer
class my data
extends data
my data(string foo, string bar, integer baz)
this • foo = foo
this • bar = bar
this • baz = baz
test case test simple display()
data object : my data • new("aaa", "bbb", 68)
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(runtime utildisplay(data object))
assert "my_data {\n foo: \"aaa\"\n bar: \"bbb\"\n baz: 68\n}\n" == the writerelements()
class my data2
extends data
dont display string or null bar
dont display integer baz
my data2(string foo, string or null bar, integer baz)
this • foo = foo
this • bar = bar
this • baz = baz
test case test display with annotations()
data object : my data2 • new("aaa", missinginstance, 68)
the writer : string writer • new()
the formatter : plain formatter • new(the writer)
the formatterwrite(runtime utildisplay(data object))
assert "my_data2 {\n foo: \"aaa\"\n}\n" == the writerelements()