(t *testing.T)
| 78 | } |
| 79 | |
| 80 | func TestNewWireGuardConfigLatencyNested(t *testing.T) { |
| 81 | configJSON := `{ |
| 82 | "latency": { |
| 83 | "test_url": "https://example.com/generate_204", |
| 84 | "timeout_seconds": 9 |
| 85 | } |
| 86 | }` |
| 87 | |
| 88 | config, err := NewConfig(configJSON) |
| 89 | if err != nil { |
| 90 | t.Fatalf("NewConfig failed: %v", err) |
| 91 | } |
| 92 | if config.Latency == nil { |
| 93 | t.Fatal("expected latency config") |
| 94 | } |
| 95 | if config.Latency.TestURL != "https://example.com/generate_204" { |
| 96 | t.Errorf("expected latency.test_url to round-trip, got: %s", config.Latency.TestURL) |
| 97 | } |
| 98 | if config.Latency.TimeoutSeconds != 9 { |
| 99 | t.Errorf("expected latency.timeout_seconds 9, got: %d", config.Latency.TimeoutSeconds) |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | func TestNewWireGuardConfigInvalidJSON(t *testing.T) { |
| 104 | configJSON := `{invalid json}` |
nothing calls this directly
no test coverage detected