mirror of
https://github.com/lune-org/lune.git
synced 2024-12-14 22:51:05 +00:00
30 lines
886 B
Lua
30 lines
886 B
Lua
local roblox = require("@lune/roblox") :: any
|
|
local Instance = roblox.Instance
|
|
|
|
local game = Instance.new("DataModel")
|
|
|
|
-- Workspace should always exist as a "Workspace" property, or be created when accessed
|
|
|
|
assert(game.Workspace ~= nil)
|
|
assert(game.Workspace:IsA("Workspace"))
|
|
assert(game.Workspace == game:FindFirstChildOfClass("Workspace"))
|
|
|
|
-- GetService and FindService should work, GetService should create services that don't exist
|
|
|
|
assert(game:FindService("CSGDictionaryService") == nil)
|
|
assert(game:GetService("CSGDictionaryService") ~= nil)
|
|
assert(game:FindService("CSGDictionaryService") ~= nil)
|
|
|
|
-- Service names should be strict and not allow weird characters or substrings
|
|
|
|
assert(not pcall(function()
|
|
game:GetService("wrorokspacey")
|
|
end))
|
|
|
|
assert(not pcall(function()
|
|
game:GetService("Work-space")
|
|
end))
|
|
|
|
assert(not pcall(function()
|
|
game:GetService("workspac")
|
|
end))
|