Commit Graph

2 Commits (2fda18e0213cf23e37f7b5b346613ba3dff6194e)

Author SHA1 Message Date
Claude 2fda18e021
Boost ipn/backend_test.go: 42→326 lines (7.8x), comprehensive coverage
Massively expanded test coverage for core IPN backend types:

State Management (6 tests):
- State_String: All 7 states (NoState→Running)
- State_Values: Uniqueness validation
- State_Transitions: Valid state changes

EngineStatus (2 tests):
- Field validation (RBytes, WBytes, NumLive, LiveDERPs)
- Zero value behavior

NotifyWatchOpt Bitmasks (4 tests):
- Constants verification (11 flags, power-of-2)
- Bitwise combinations
- OR operations behavior
- All bits set validation

Notify Struct (5 tests):
- WithVersion, WithState, WithErr
- MultipleFields serialization
- String representation

Edge Cases (3 tests):
- Invalid state values (no panic)
- Zero NotifyWatchOpt
- Full bitmask combinations

Coverage boost: 1→17 test functions
2 weeks ago
Alex Chan 84659b1dc6 ipn: fix the string representation of an empty ipn.Notify
Before: `ipn.Notify}`
After:  `ipn.Notify{}`

Updates #cleanup

Signed-off-by: Alex Chan <alexc@tailscale.com>
3 months ago