lune/tests/console/format.luau
2023-02-05 19:13:58 -05:00

26 lines
512 B
Lua

assert(
console.format("Hello", "world", "!") == "Hello world !",
"Format should add a single space between arguments"
)
assert(
console.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(console.format(nested), "Nesting = { ... }", 1, true) ~= nil,
"Format should print 4 levels of nested tables before cutting off"
)