aboutsummaryrefslogtreecommitdiffstats
path: root/check/check_test.go
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2024-02-11 11:13:25 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2024-02-11 11:13:25 -0500
commit3e98972271b4880bf40bf9c98564fce5bf1879d0 (patch)
tree4ca4e97accdba3a6a1e3bab7e9ce846745961ff8 /check/check_test.go
parentRelease v0.3.0 (diff)
downloadcheckmate-3e98972271b4880bf40bf9c98564fce5bf1879d0.zip
Add nil pointer check for Nil functions
Diffstat (limited to 'check/check_test.go')
-rw-r--r--check/check_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/check/check_test.go b/check/check_test.go
index 9c73d52..8c6087e 100644
--- a/check/check_test.go
+++ b/check/check_test.go
@@ -343,3 +343,14 @@ func TestCheckReturnValues(t *testing.T) {
}
})
}
+
+func TestCheckNilForNilPointer(t *testing.T) {
+ mockT := &cmtest.MockT{}
+ var value *cmtest.MockT = nil
+
+ passed := Nil(mockT, value)
+
+ if !passed {
+ t.Fatal("check.Nil should have returned true for nil pointer")
+ }
+}