lune/tests/console/set_style.luau

16 lines
496 B
Lua
Raw Normal View History

2023-01-21 06:37:31 +00:00
local VALID_STYLES = { "bold", "dim" }
local INVALID_STYLES = { "", "*bold*", "dimm", "megabright", "cheerful", "sad", " " }
for _, style in VALID_STYLES do
if not pcall(console.setStyle, style :: any) then
error(string.format("Setting style failed for style '%s'", style))
end
end
for _, style in INVALID_STYLES do
if pcall(console.setStyle, style :: any) then
console.resetStyle()
error(string.format("Setting style should have failed for style '%s' but succeeded", style))
end
end