State package has 0% test coverage #70
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
internal/statepackage has 0% test coverage. It only contains astate_test_helper.gofile (which providesNewForTest()for other packages) but no actual tests for the state package itself.What is Untested
Load()— reading and parsing state from diskSave()— atomic write (temp file + rename)GetSnapshot()— snapshot copyingPortState.UnmarshalJSON()— backward-compatible deserialization (old single-hostname format → new multi-hostname format)Why This Matters
The state file is the daemon's persistence layer. Bugs here cause:
Recommendation
Add tests covering at minimum:
Category
Should-fix before 1.0. State persistence is a core feature and should have test coverage.