2023-05-20 18:49:37 +01:00
|
|
|
local roblox = require("@lune/roblox")
|
2023-03-26 08:38:59 +01:00
|
|
|
local Instance = roblox.Instance
|
|
|
|
|
|
|
|
local game = Instance.new("DataModel")
|
|
|
|
|
2023-03-27 14:59:06 +01:00
|
|
|
-- Workspace should always exist as a "Workspace" property, or be created when accessed
|
|
|
|
|
2023-05-20 18:49:37 +01:00
|
|
|
local workspace = (game :: any).Workspace
|
|
|
|
assert(workspace ~= nil)
|
|
|
|
assert(workspace:IsA("Workspace"))
|
|
|
|
assert(workspace == game:FindFirstChildOfClass("Workspace"))
|
2023-03-27 14:59:06 +01:00
|
|
|
|
|
|
|
-- GetService and FindService should work, GetService should create services that don't exist
|
2023-03-26 08:38:59 +01:00
|
|
|
|
|
|
|
assert(game:FindService("CSGDictionaryService") == nil)
|
2023-05-20 18:49:37 +01:00
|
|
|
assert(game:GetService("CSGDictionaryService"))
|
2023-03-26 08:38:59 +01:00
|
|
|
assert(game:FindService("CSGDictionaryService") ~= nil)
|
|
|
|
|
2023-03-27 14:59:06 +01:00
|
|
|
-- Service names should be strict and not allow weird characters or substrings
|
|
|
|
|
2023-03-26 08:38:59 +01:00
|
|
|
assert(not pcall(function()
|
|
|
|
game:GetService("wrorokspacey")
|
|
|
|
end))
|
|
|
|
|
|
|
|
assert(not pcall(function()
|
2023-03-27 14:59:06 +01:00
|
|
|
game:GetService("Work-space")
|
2023-03-26 08:38:59 +01:00
|
|
|
end))
|
|
|
|
|
|
|
|
assert(not pcall(function()
|
|
|
|
game:GetService("workspac")
|
|
|
|
end))
|