mapper_windows_test: assert.NotZero for nil check (#396)
Follow up to #394, specifically [this comment][1]. [1]: https://github.com/alecthomas/kong/pull/394#discussion_r1421683093
This commit is contained in:
@@ -33,7 +33,7 @@ func TestWindowsFileMapper(t *testing.T) {
|
|||||||
p := mustNew(t, &cli)
|
p := mustNew(t, &cli)
|
||||||
_, err := p.Parse([]string{"testdata\\file.txt"})
|
_, err := p.Parse([]string{"testdata\\file.txt"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.True(t, cli.File != nil, "File should not be nil")
|
assert.NotZero(t, cli.File, "File should not be nil")
|
||||||
_ = cli.File.Close()
|
_ = cli.File.Close()
|
||||||
_, err = p.Parse([]string{"testdata\\missing.txt"})
|
_, err = p.Parse([]string{"testdata\\missing.txt"})
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user