quad/quad-base/test/smoke.mock.luau
qwreey-agent-selene 205af32da4
tooling: 프로젝트 셋업 문서화 + wally→pesde 전환, M1 스캐폴딩 골격
pesde 워크스페이스 실제 설치·검증(패키지명 하이픈 금지, workspace 의존성
문법, per-package pesde.lock), init.luau의 @self require 규칙(Luau RFC
확인), 워크스페이스 의존성이 심볼릭 링크라 luau CLI의 require-by-string과
충돌하는 함정을 base/project-setup-plan.md로 정리. architecture.md
패키징 방식 절도 같이 정정. Relate.luau/New()-InitXxx 골격/mock 하네스는
이 구조를 실제로 검증하는 과정에서 나온 최소 스캐폴딩.

Co-authored-by: qwreey <me@qwreey.moe>
2026-08-19 14:01:07 +09:00

59 lines
1.6 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)
assert(root:FindFirstChild("B") == child2)
assert(child1.Parent == root)
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 ===")