(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestParseStatNameValid(t *testing.T) { |
| 10 | name, link, statType, ok := parseStatName("user>>>alice@example.com>>>traffic>>>uplink") |
| 11 | if !ok { |
| 12 | t.Fatal("expected valid stat name") |
| 13 | } |
| 14 | if name != "alice@example.com" { |
| 15 | t.Fatalf("unexpected name: got %q", name) |
| 16 | } |
| 17 | if link != "traffic" { |
| 18 | t.Fatalf("unexpected link: got %q", link) |
| 19 | } |
| 20 | if statType != "uplink" { |
| 21 | t.Fatalf("unexpected type: got %q", statType) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | func TestParseStatNameRejectsMalformed(t *testing.T) { |
| 26 | tests := []string{ |
nothing calls this directly
no test coverage detected