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

15 lines
546 B
Lua

local VALID_COLORS = { "black", "red", "green", "yellow", "blue", "purple", "cyan", "white" }
local INVALID_COLORS = { "", "gray", "grass", "red?", "super red", " ", "none" }
for _, color in VALID_COLORS do
if not pcall(console.setColor, color :: any) then
error(string.format("Setting color failed for color '%s'", color))
end
end
for _, color in INVALID_COLORS do
if pcall(console.setColor, color :: any) then
console.resetColor()
error(string.format("Setting color should have failed for color '%s' but succeeded", color))
end
end