Add test to ensure warn global exists and is a function

This commit is contained in:
Filip Tibell 2023-08-20 20:02:01 -05:00
parent 4412d02b34
commit 02c9bce645
2 changed files with 6 additions and 0 deletions

View file

@ -84,6 +84,7 @@ create_tests! {
global_pcall: "globals/pcall", global_pcall: "globals/pcall",
global_type: "globals/type", global_type: "globals/type",
global_typeof: "globals/typeof", global_typeof: "globals/typeof",
global_warn: "globals/warn",
serde_compression_files: "serde/compression/files", serde_compression_files: "serde/compression/files",
serde_compression_roundtrip: "serde/compression/roundtrip", serde_compression_roundtrip: "serde/compression/roundtrip",

5
tests/globals/warn.luau Normal file
View file

@ -0,0 +1,5 @@
assert(warn ~= nil, "Missing 'warn' global")
assert(
type(warn) == "function",
string.format("Global 'warn' should be a function, got '%s'", tostring(type(warn)))
)