Record original-alignment implementation and traceability checkpoint
Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
This commit is contained in:
@@ -15,6 +15,7 @@ func _initialize() -> void:
|
||||
func _run() -> void:
|
||||
var clock := root.get_node_or_null("GameClock")
|
||||
if clock != null: clock.set_paused(true)
|
||||
_test_paired_boarding()
|
||||
_test_grouping()
|
||||
_test_capacity_and_time()
|
||||
_test_access_and_shared_cabin()
|
||||
@@ -256,3 +257,48 @@ func _expect(condition: bool, label: String) -> void:
|
||||
else:
|
||||
_failures += 1
|
||||
push_error("FAIL: %s" % label)
|
||||
|
||||
|
||||
func _test_paired_boarding() -> void:
|
||||
_setup(1)
|
||||
for i: int in range(7): _request(StringName("a%d" % i), 0, 3, 1)
|
||||
_expect(_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"ok"], "rescue pair reserves two real seats")
|
||||
var before := _elevators.create_snapshot()
|
||||
_expect(_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"replay"] and _elevators.create_snapshot() == before, "pair retry is idempotent")
|
||||
_tick()
|
||||
_expect(_car()[&"passenger_count"] == 7 and _car()[&"waiting_count"] == 2, "one remaining seat never splits the rescue pair")
|
||||
_expect(_elevators.get_actor_trip(&"medic")[&"state"] == _elevators.get_actor_trip(&"patient")[&"state"], "pair retains the same queued state")
|
||||
var state := _elevators.create_snapshot()
|
||||
var paths := _path.create_snapshot()
|
||||
var arrivals := _tick(150)
|
||||
var paired: Array[Dictionary] = []
|
||||
for arrival: Dictionary in arrivals:
|
||||
if arrival[&"actor_id"] in [&"medic", &"patient"]: paired.append(arrival)
|
||||
_expect(paired.size() == 2 and paired[0][&"cell"] == paired[1][&"cell"], "both rescue passengers arrive at the same landing")
|
||||
_expect(_path.restore_snapshot(paths) and _elevators.restore_snapshot(state), "queued pair and seat ownership restore")
|
||||
_minute = state[&"current_minute"]
|
||||
_expect(_tick(150) == arrivals, "queued pair replays exact arrivals")
|
||||
_setup(1)
|
||||
_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])
|
||||
_expect(_elevators.cancel_actor(&"patient") and _elevators.get_report()[&"trips"].is_empty() and _path.get_active_elevator_request(&"medic").is_empty(), "queued cancellation releases both passengers")
|
||||
_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])
|
||||
_tick(10)
|
||||
state = _elevators.create_snapshot(); paths = _path.create_snapshot()
|
||||
_expect(not _elevators.cancel_actor(&"patient") and _elevators.create_snapshot() == state, "onboard pair cannot teleport out through cancellation")
|
||||
var corrupt := state.duplicate(true)
|
||||
corrupt[&"trips"][0][&"companion_id"] = &"missing"
|
||||
_expect(not _elevators.restore_snapshot(corrupt) and _elevators.create_snapshot() == state, "orphan companion save is rejected atomically")
|
||||
_expect(_elevators.restore_snapshot(state), "boarded pair restores")
|
||||
var released := _elevators.set_powered(_config[&"shaft_id"], false, _minute)
|
||||
_expect(released.size() == 2 and released[0][&"cell"] == released[1][&"cell"] and released[0][&"emergency"] and released[1][&"emergency"], "power loss unloads the pair together")
|
||||
_expect(_elevators.restore_snapshot(_elevators.create_snapshot()), "emergency release leaves a valid snapshot")
|
||||
_setup(1)
|
||||
_request(&"patient", 0, 2, 1)
|
||||
state = _elevators.create_snapshot(); paths = _path.create_snapshot()
|
||||
_expect(not _elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"ok"] and _elevators.create_snapshot() == state and _path.create_snapshot() == paths, "conflicting pair reservation leaves all ownership unchanged")
|
||||
|
||||
_setup(1)
|
||||
for i: int in range(ElevatorService.QUEUE_CAPACITY - 1): _request(StringName("crowd_%d" % i), 0, 3, 1)
|
||||
state = _elevators.create_snapshot(); paths = _path.create_snapshot()
|
||||
_expect(_car()[&"waiting_count"] == ElevatorService.QUEUE_CAPACITY - 1, "queue fixture has exactly one free request slot")
|
||||
_expect(not _elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"ok"] and _elevators.create_snapshot() == state and _path.create_snapshot() == paths, "second-member queue rejection rolls back first member and request sequence")
|
||||
|
||||
Reference in New Issue
Block a user