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

15 lines
496 B
Lua

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