Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit a254ec2

Browse files
committed
Avoid duplicate error logs in tests
1 parent aae214e commit a254ec2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

alerting_contact_point_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ func TestContactPoints(t *testing.T) {
1818
}
1919
t.Log(pretty.PrettyFormat(ps))
2020
if len(ps) != 2 {
21-
t.Errorf("wrong number of contact points returned, got %#v", ps)
21+
t.Errorf("wrong number of contact points returned, got %d", len(ps))
2222
}
2323
if ps[0].UID != "" {
24-
t.Errorf("incorrect UID - expected %s on element %d, got %#v", "", 0, ps)
24+
t.Errorf("incorrect UID - expected %s on element %d, got %s", "", 0, ps[0].UID)
2525
}
2626
if ps[1].UID != "rc5r0bjnz" {
27-
t.Errorf("incorrect UID - expected %s on element %d, got %#v", "rc5r0bjnz", 0, ps)
27+
t.Errorf("incorrect UID - expected %s on element %d, got %s", "rc5r0bjnz", 1, ps[1].UID)
2828
}
2929
})
3030

@@ -39,10 +39,10 @@ func TestContactPoints(t *testing.T) {
3939
}
4040
t.Log(pretty.PrettyFormat(ps))
4141
if len(ps) != 1 {
42-
t.Errorf("wrong number of contact points returned, got %#v", ps)
42+
t.Errorf("wrong number of contact points returned, got %d", len(ps))
4343
}
4444
if ps[0].UID != "rc5r0bjnz" {
45-
t.Errorf("incorrect UID - expected %s on element %d, got %#v", "rc5r0bjnz", 0, ps)
45+
t.Errorf("incorrect UID - expected %s on element %d, got %s", "rc5r0bjnz", 0, ps[0].UID)
4646
}
4747
})
4848

@@ -57,7 +57,7 @@ func TestContactPoints(t *testing.T) {
5757
}
5858
t.Log(pretty.PrettyFormat(p))
5959
if p.UID != "rc5r0bjnz" {
60-
t.Errorf("incorrect UID - expected %s got %#v", "rc5r0bjnz", p)
60+
t.Errorf("incorrect UID - expected %s got %s", "rc5r0bjnz", p.UID)
6161
}
6262
})
6363

0 commit comments

Comments
 (0)