File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,14 +16,18 @@ func TestNilPtr(t *testing.T) {
1616 })
1717 t .Run ("should panic when pointer is not nil" , func (t * testing.T ) {
1818 t .Parallel ()
19+
1920 value := "test"
21+
2022 assert .PanicsWithValue (t , "assertion failed: Test pointer should be a nil pointer" , func () {
2123 NilPtr ("Test pointer" , & value )
2224 })
2325 })
2426 t .Run ("should use given name in panic message" , func (t * testing.T ) {
2527 t .Parallel ()
28+
2629 value := 42
30+
2731 assert .PanicsWithValue (t , "assertion failed: Other value should be a nil pointer" , func () {
2832 NilPtr ("Other value" , & value )
2933 })
@@ -33,6 +37,7 @@ func TestNilPtr(t *testing.T) {
3337func TestNotNilPtr (t * testing.T ) {
3438 t .Run ("should accept not-nil pointer & return same pointer" , func (t * testing.T ) {
3539 t .Parallel ()
40+
3641 value := 42
3742 assert .Same (t , & value , NotNilPtr ("Test pointer" , & value ))
3843 })
You can’t perform that action at this time.
0 commit comments