Skip to content

Commit c53cb2e

Browse files
authored
Merge pull request #21 from C6H15/tests/add-player
Update and add player-related unit tests
2 parents 7a25777 + b96db8a commit c53cb2e

9 files changed

Lines changed: 2967 additions & 1679 deletions

File tree

src/Classes/Zone.luau

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,8 +1209,8 @@ function Zone.destroy(self: Types.InternalZone): ()
12091209
end
12101210
end
12111211

1212-
-- Clear the reference before the onDestroyCallbacks are firedThis to ensure that,
1213-
-- when the callback attempts to detach the observer manually,
1212+
-- Clear the reference before the onDestroyCallbacks are fired.
1213+
-- This is to ensure that, when the callback attempts to detach the observer manually,
12141214
-- it safely early-returns without double-decrementing the count.
12151215
State.zoneAttachedObservers[id] = nil
12161216

tests/Runtime.server.luau

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
--!strict
2-
local ServerScriptService = game:GetService("ServerScriptService")
2+
local ServerScriptService = game:GetService('ServerScriptService')
33

44
local TestFolder = ServerScriptService.Test
55
local TiniestFolder = TestFolder.Tiniest
66
local SpecificationsFolder = TestFolder.Specifications
77

88
local Tiniest = require(TiniestFolder.tiniest_for_roblox).configure({})
99

10-
local Tests = Tiniest.collect_tests_from_hierarchy(SpecificationsFolder)
11-
local Results = Tiniest.run_tests(Tests, {})
10+
local tests = Tiniest.collect_tests_from_hierarchy(SpecificationsFolder)
11+
local results = Tiniest.run_tests(tests, {})
1212

13-
local PassCount = Results.status_tally.pass
14-
local FailCount = Results.status_tally.fail
13+
local passCount = results.status_tally.pass
14+
local failCount = results.status_tally.fail
1515

16-
if FailCount > 0 then
17-
warn(`[QuickZone Tests]: {FailCount}/{PassCount + FailCount} test(s) failed!`)
16+
if failCount > 0 then
17+
warn(`[QuickZone Tests]: {failCount}/{passCount + failCount} test(s) failed!`)
1818
end

0 commit comments

Comments
 (0)