Skip to content

Commit 97ecf3e

Browse files
committed
Fail tests appropriately
1 parent 1f9b17e commit 97ecf3e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pointer/pointer_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ func TestTo(t *testing.T) {
1212
v := true
1313
pv := pointer.To(v)
1414
if pv == nil {
15-
t.Fatal("expected non-nil pointer")
15+
t.Error("expected non-nil pointer")
1616
} else if v != *pv {
17-
t.Fatalf("expected %v, got %v", v, *pv)
17+
t.Errorf("expected %v, got %v", v, *pv)
1818
}
1919
}
2020

@@ -26,7 +26,7 @@ func TestFrom(t *testing.T) {
2626
pv := new(bool)
2727
v := pointer.From(pv)
2828
if v != *pv {
29-
t.Fatalf("expected %v, got %v", *pv, v)
29+
t.Errorf("expected %v, got %v", *pv, v)
3030
}
3131
})
3232

@@ -36,7 +36,7 @@ func TestFrom(t *testing.T) {
3636
var pv *bool
3737
v := pointer.From(pv)
3838
if v != e {
39-
t.Fatalf("expected %v, got %v", e, v)
39+
t.Errorf("expected %v, got %v", e, v)
4040
}
4141
})
4242
}
@@ -49,7 +49,7 @@ func TestToOrNil(t *testing.T) {
4949
var v string
5050
pv := pointer.ToOrNil(v)
5151
if pv != nil {
52-
t.Fatalf("expected nil pointer, got %v", pv)
52+
t.Errorf("expected nil pointer, got %v", pv)
5353
}
5454
})
5555

@@ -58,9 +58,9 @@ func TestToOrNil(t *testing.T) {
5858
v := "non-zero"
5959
pv := pointer.ToOrNil(v)
6060
if pv == nil {
61-
t.Fatal("expected non-nil pointer")
61+
t.Error("expected non-nil pointer")
6262
} else if v != *pv {
63-
t.Fatalf("expected %v, got %v", v, *pv)
63+
t.Errorf("expected %v, got %v", v, *pv)
6464
}
6565
})
6666

@@ -69,9 +69,9 @@ func TestToOrNil(t *testing.T) {
6969
v := time.Date(2014, 6, 25, 12, 24, 40, 0, time.UTC)
7070
pv := pointer.ToOrNil(v)
7171
if pv == nil {
72-
t.Fatal("expected non-nil pointer")
72+
t.Error("expected non-nil pointer")
7373
} else if v != *pv {
74-
t.Fatalf("expected %v, got %v", v, *pv)
74+
t.Errorf("expected %v, got %v", v, *pv)
7575
}
7676
})
7777

@@ -80,7 +80,7 @@ func TestToOrNil(t *testing.T) {
8080
v := time.Time{}
8181
pv := pointer.ToOrNil(v)
8282
if pv != nil {
83-
t.Fatal("expected nil pointer")
83+
t.Error("expected nil pointer")
8484
}
8585
})
8686
}

0 commit comments

Comments
 (0)