lune/tests/task/fcheck.luau

15 lines
270 B
Lua
Raw Normal View History

local stdio = require("@lune/stdio")
2023-01-24 17:52:41 +00:00
return function(index: number, type: string, value: any)
if typeof(value) ~= type then
error(
2023-01-24 17:52:41 +00:00
string.format(
"Expected argument #%d to be of type %s, got %s",
index,
type,
2023-02-06 05:13:12 +00:00
stdio.format(value)
2023-01-24 17:52:41 +00:00
)
)
end
end