MCPcopy Create free account
hub / github.com/PasarGuard/node / TestParseStatNameValid

Function TestParseStatNameValid

backend/xray/api/stats_test.go:9–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func 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
25func TestParseStatNameRejectsMalformed(t *testing.T) {
26 tests := []string{

Callers

nothing calls this directly

Calls 1

parseStatNameFunction · 0.85

Tested by

no test coverage detected