lune/tests/stdio/format.luau

27 lines
506 B
Lua
Raw Normal View History

2023-01-21 06:37:31 +00:00
assert(
2023-02-06 05:13:12 +00:00
stdio.format("Hello", "world", "!") == "Hello world !",
2023-01-21 06:37:31 +00:00
"Format should add a single space between arguments"
)
assert(
2023-02-06 05:13:12 +00:00
stdio.format({ Hello = "World" }) == '{\n Hello = "World",\n}',
2023-01-21 06:37:31 +00:00
"Format should print out proper tables"
)
local nested = {
Oh = {
No = {
TooMuch = {
Nesting = {
"Will not print",
},
},
},
},
}
assert(
2023-02-06 05:13:12 +00:00
string.find(stdio.format(nested), "Nesting = { ... }", 1, true) ~= nil,
2023-01-21 06:37:31 +00:00
"Format should print 4 levels of nested tables before cutting off"
)