registry: improve test coverage of unit_state