quad/quad-base/test/smoke.mock.luau
qwreey-agent-selene ef3d952dd4
tooling: rokit → mise 전환 + selene 린터 도입 (roblox-project-example 벤치마킹)
Word30210/roblox-project-example(initreq/에 클론)를 참고해 두 가지 채택:
(1) rokit.toml → mise.toml — mise install이 pesde/rojo/luau-lsp/selene을
GitHub attestation+SLSA provenance 검증까지 거쳐 설치하는 걸 이 샌드박스
에서 직접 확인(rokit은 끝내 검증 불가), 이 환경 자체가 이미 mise로
luau를 관리 중이라 더 자연스러움. (2) selene 린터 — 참고 레포의
selene.toml을 패키지별로 채택, 단 CWD 상대 config 탐색 함정을 발견
(루트 단일 설정으로 두면 다른 디렉토리에서 실행 시 조용히 Lua 5.1
std로 폴백해 Luau 타입 문법 전체가 파싱 에러로 잘못 보임) — 참고 레포
그대로 패키지별 selene.toml + 패키지 안에서 실행하는 걸로 확정. 도입
즉시 smoke.mock.luau의 assert 메시지 누락 3건을 잡아 수정.

darklua의 convert_require 변환은 검토 후 기각 — 사용자 판단: Roblox
엔진 자체도 이미 같은 require-by-string 의미론(@self/@game)을 지원해
변환 계층이 불필요.

Co-authored-by: qwreey <me@qwreey.moe>
2026-08-19 15:09:35 +09:00

59 lines
1.7 KiB
Text

--[[ 임시 스모크 테스트 — mock.luau 자체가 기대대로 동작하는지 확인 ]]
local mock = require("./mock")
local Instance = mock.Instance
print("=== 1. property bag + changed signal ===")
do
local frame = Instance.new("Frame")
local fired = {}
frame:GetPropertyChangedSignal("Visible"):Connect(function()
table.insert(fired, frame.Visible)
end)
frame.Visible = false
frame.Visible = true
assert(#fired == 2 and fired[1] == false and fired[2] == true, "changed signal must fire per write with the new value visible")
print("PASS")
end
print()
print("=== 2. parent/children tree ===")
do
local root = Instance.new("Frame")
local child1 = Instance.new("Frame")
local child2 = Instance.new("Frame")
child1.Name = "A"
child2.Name = "B"
child1.Parent = root
child2.Parent = root
local children = root:GetChildren()
assert(#children == 2, "expected 2 children")
assert(root:FindFirstChild("A") == child1, "FindFirstChild must locate child by Name")
assert(root:FindFirstChild("B") == child2, "FindFirstChild must locate child by Name")
assert(child1.Parent == root, "Parent must read back what was assigned")
child1.Parent = nil
assert(#root:GetChildren() == 1, "removing Parent must detach from old parent's children")
print("PASS")
end
print()
print("=== 3. Destroy fires Destroying + detaches ===")
do
local root = Instance.new("Frame")
local child = Instance.new("Frame")
child.Parent = root
local destroyed = false
child.Destroying:Connect(function()
destroyed = true
end)
child:Destroy()
assert(destroyed, "Destroying must fire on Destroy")
assert(#root:GetChildren() == 0, "Destroy must detach from parent")
print("PASS")
end
print()
print("=== ALL PASS ===")