Expand typeof global test suite

This commit is contained in:
Filip Tibell 2023-10-03 21:21:13 -05:00
parent 414d8ff8f3
commit 462e9a4f5a
No known key found for this signature in database

View file

@ -1,3 +1,6 @@
-- NOTE: luau-lsp warns without this for the roblox types below
--!nolint UnknownType
local task = require("@lune/task") local task = require("@lune/task")
local function f() end local function f() end
@ -14,3 +17,13 @@ assert(
assert(typeof(thread2) == "thread", "Calling typeof() did not return 'thread' after task.spawn") assert(typeof(thread2) == "thread", "Calling typeof() did not return 'thread' after task.spawn")
assert(typeof(thread3) == "thread", "Calling typeof() did not return 'thread' after task.defer") assert(typeof(thread3) == "thread", "Calling typeof() did not return 'thread' after task.defer")
assert(typeof(thread4) == "thread", "Calling typeof() did not return 'thread' after delay") assert(typeof(thread4) == "thread", "Calling typeof() did not return 'thread' after delay")
local roblox = require("@lune/roblox")
local rbx1 = roblox.Instance.new("Part")
local rbx2 = (roblox :: any).Vector3.zero
local rbx3 = (roblox :: any).Enum.KeyCode.A
assert(typeof(rbx1) == "Instance", "Calling typeof() did not return 'Instance' for Instance.new")
assert(typeof(rbx2) == "Vector3", "Calling typeof() did not return 'Vector3' for Vector3.zero")
assert(typeof(rbx3) == "EnumItem", "Calling typeof() did not return 'EnumItem' for Enum.KeyCode.A")