ucg/integration_tests/format_test.ucg

36 lines
668 B
Plaintext
Raw Normal View History

let t = import "std/testing.ucg".asserts{};
assert t.equal{
left = "hello @" % ("world"),
right = "hello world",
};
assert t.equal{
left = "1 @ @" % (2, 3),
right = "1 2 3",
};
assert t.equal{
left = "@ or @" % (true, false),
right = "true or false",
};
assert t.equal{
left = "@" % (NULL),
right = "NULL",
};
assert t.equal{
left = "bar is just great" % {foo="bar"},
right = "bar is just great",
};
assert t.equal{
left = "@{item.foo} is just great" % {foo="bar"},
right = "bar is just great",
};
assert t.equal{
left = "@{{foo=item.foo}.foo} is just great" % {foo="bar"},
right = "bar is just great",
};