mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 21:10:36 +00:00
16 lines
462 B
Lua
16 lines
462 B
Lua
local stdio = require("@lune/stdio")
|
|
|
|
local STYLES_VALID = { "reset", "bold", "dim" }
|
|
local STYLES_INVALID = { "", "*bold*", "dimm", "megabright", "cheerful", "sad", " " }
|
|
|
|
for _, style in STYLES_VALID do
|
|
stdio.style(style :: any)
|
|
stdio.style("reset")
|
|
end
|
|
|
|
for _, style in STYLES_INVALID do
|
|
if pcall(stdio.style, style :: any) then
|
|
stdio.style("reset")
|
|
error(string.format("Setting style should have failed for style '%s' but succeeded", style))
|
|
end
|
|
end
|