lune/tests/stdio/format.luau
2023-02-06 00:13:12 -05:00

26 lines
506 B
Lua

assert(
stdio.format("Hello", "world", "!") == "Hello world !",
"Format should add a single space between arguments"
)
assert(
stdio.format({ Hello = "World" }) == '{\n Hello = "World",\n}',
"Format should print out proper tables"
)
local nested = {
Oh = {
No = {
TooMuch = {
Nesting = {
"Will not print",
},
},
},
},
}
assert(
string.find(stdio.format(nested), "Nesting = { ... }", 1, true) ~= nil,
"Format should print 4 levels of nested tables before cutting off"
)