MCPcopy Create free account
hub / github.com/coder/coder / TestLabelsEqual

Function TestLabelsEqual

agent/proto/compare_test.go:11–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestLabelsEqual(t *testing.T) {
12 t.Parallel()
13 for _, tc := range []struct {
14 name string
15 a []*proto.Stats_Metric_Label
16 b []*proto.Stats_Metric_Label
17 eq bool
18 }{
19 {
20 name: "mainlineEq",
21 a: []*proto.Stats_Metric_Label{
22 {Name: "credulity", Value: "sus"},
23 {Name: "color", Value: "aquamarine"},
24 },
25 b: []*proto.Stats_Metric_Label{
26 {Name: "credulity", Value: "sus"},
27 {Name: "color", Value: "aquamarine"},
28 },
29 eq: true,
30 },
31 {
32 name: "emptyValue",
33 a: []*proto.Stats_Metric_Label{
34 {Name: "credulity", Value: "sus"},
35 {Name: "color", Value: "aquamarine"},
36 {Name: "singularity", Value: ""},
37 },
38 b: []*proto.Stats_Metric_Label{
39 {Name: "credulity", Value: "sus"},
40 {Name: "color", Value: "aquamarine"},
41 },
42 eq: true,
43 },
44 {
45 name: "extra",
46 a: []*proto.Stats_Metric_Label{
47 {Name: "credulity", Value: "sus"},
48 {Name: "color", Value: "aquamarine"},
49 {Name: "opacity", Value: "seyshells"},
50 },
51 b: []*proto.Stats_Metric_Label{
52 {Name: "credulity", Value: "sus"},
53 {Name: "color", Value: "aquamarine"},
54 },
55 eq: false,
56 },
57 {
58 name: "different",
59 a: []*proto.Stats_Metric_Label{
60 {Name: "credulity", Value: "sus"},
61 {Name: "color", Value: "aquamarine"},
62 },
63 b: []*proto.Stats_Metric_Label{
64 {Name: "credulity", Value: "legit"},
65 {Name: "color", Value: "aquamarine"},
66 },
67 eq: false,
68 },

Callers

nothing calls this directly

Calls 3

LabelsEqualFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected