diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2024-02-11 11:13:25 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2024-02-11 11:13:25 -0500 |
| commit | 3e98972271b4880bf40bf9c98564fce5bf1879d0 (patch) | |
| tree | 4ca4e97accdba3a6a1e3bab7e9ce846745961ff8 /check/check_test.go | |
| parent | Release v0.3.0 (diff) | |
| download | checkmate-3e98972271b4880bf40bf9c98564fce5bf1879d0.zip | |
Add nil pointer check for Nil functions
Diffstat (limited to 'check/check_test.go')
| -rw-r--r-- | check/check_test.go | 11 |
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") + } +} |