Commit Graph

1 Commits (54aaf7c720a419d873d59e365d4ff50e68d26721)

Author SHA1 Message Date
Claude 3fb14c9374
COMPREHENSIVE: debugderp_test.go 0→1,236 lines, 24 tests! 🌐
Complete testing for serveDebugDERPRegion (307-line handler with ZERO tests):
• Permission checks (PermitWrite)
• Method validation (POST requirement)
• DERP map validation (nil map, empty map)
• Region lookup (by ID and by code)
• Region validation:
  - Non-existent regions (by ID/code)
  - Single region warning (single point of failure)
  - Multiple regions (no warning)
  - Avoid bit warning
  - Empty/nil nodes error
• Node configuration:
  - STUN-only nodes
  - Multiple nodes per region
  - IPv4/IPv6 validation
• Edge cases:
  - Empty/missing region parameter
  - Region ID 0, negative IDs, very large IDs
  - Special characters in region codes (us-west-2)
  - Case-sensitive region code matching
• Response structure validation (JSON encoding)

Session total: 9,188 lines → Target: 10,000 (812 to go!)
2 months ago