Log inGet started
Package

sensorGoggles.testSuite

README.md

sensorGoggles (test suite)

Checks a player's own goggles through the Goggles module: on, off and toggle change Goggles.state() (and the sensor local entries go once the 0.25 s off fade ends), next and previous wrap at both ends and next puts the goggles on, setPowerStyle and setHud take the documented values and refuse others, power ramps from 0 to 1 over the power style's time as Goggles.tick(dt) runs, the battery drains while on and recharges while off (an empty battery takes the goggles off and refuses on), on with an unknown mode id adds it, and goggles never change the synced StyleStack, only this machine's local entries.

Every test saves the goggles' modes, mode, power style, readout and battery and puts them back. It leaves the HUD's look and the automatic sonar pings to visual review.

Run: asset.resolve("sensorGoggles", "testSuite"):run().

Known limits

  • A GogglesRig in the scene also ticks the goggles every frame; tests do not yield between their own ticks, so the rig never ticks in between, but the battery can drift by a fraction of a percent across a test's waits.
  • Goggles.onChange listeners cannot be removed, so the suite does not add one and the "empty" event itself is not checked (only its effect).
  • The battery is put back by recharging, so a battery saved above its level comes back exactly, but one saved lower than 100 after the battery test refilled it to 100 stays at 100.