disguiseKitTests.testSuite
This package holds more than this page lists. See all of its files in its world.
README.md
disguiseKitTests
25 tests of disguiseKit, run in edit mode with no play session needed.
The judging and blending tests run the kit's own per-frame judging (the runtime's observe and judge, through R.beginTrial / R.trialFrame / R.endTrial) against a stand-in player, so a pass here is what decides a real player's meters in play.
- Judging a player against a watcher: a porter in a staff area in full view of a guard 6 m off keeps a meter of 0; a fisher there is seen trespassing, the meter climbs and a full meter blows their cover (the
blownevent fires); a porter with a drawn blade is noticed; a player behind the guard or beyond his 16 m is not seen at all; a foreman lets a porter pass at 6 m and 4.5 m, sees through them at 3 m ("doesn't know your face"), and never sees through a soldier. - Blending in: a monk (wrong clothes) among three townsfolkKit porters, 8 m from a guard, is in the group, blended and unnoticed; 6 m to the side, alone, the meter climbs; back in the crowd with a drawn blade it climbs again. A cook working a sweep spot for cooks on guards-only ground blends; at a spot for porters only, the same cook is noticed.
- Multiplayer: another player's synced
Wearer(a peer id and avatar that are not this peer's) dresses their body here in the porter outfit and indigo look, the body is rebuilt as a soldier when that Wearer changes, a peer that starts from nothing (a late joiner) builds the soldier, and the body goes when the Wearer does. ASharedRulesrecord as it arrives from the host opens a staff area to fishers on this peer, and a rule message from another peer closing it is written into the record by its owner. - Catalogue: ten roles with two or more looks each, six area kinds, seven rules, six watcher kinds (see-through within 4 m), six sign styles drawing every state.
- Who belongs, shared rules, errors, area geometry:
allowlists,"none","*", the kind's own list;setAreaAllow,areaAllow,tuneArea,setRule,sharedRules; errors naming what is known; box, round and overlapping areas.
What a unit suite cannot do is run two engines: the multiplayer tests check this peer's side of the sync (what it does with a Wearer and a rules record it receives). The two-machine run (two clients, one joining late) was done by hand, as the package README says.
Test entities are spawned far from the scene (around x = 620, z = -620) and removed after each test.
tools.use("tests", "run", { suite = "disguiseKitTests" })