test/volume: Replace Check with NilError where suitable
In these cases, continuing after a non nil error will result in a nil dereference in panic. Change the `assert.Check` to `assert.NilError` to avoid that. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
89b542b421
commit
435ecfe6e0
5 changed files with 6 additions and 5 deletions
|
@ -220,7 +220,7 @@ func TestLCOWParseMountRawSplit(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
assert.Check(t, err)
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Equal(m.Destination, tc.expDest))
|
||||
assert.Check(t, is.Equal(m.Source, tc.expSource))
|
||||
assert.Check(t, is.Equal(m.Name, tc.expName))
|
||||
|
|
|
@ -188,7 +188,7 @@ func TestLinuxParseMountRawSplit(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
assert.Check(t, err)
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Equal(m.Destination, tc.expDest))
|
||||
assert.Check(t, is.Equal(m.Source, tc.expSource))
|
||||
assert.Check(t, is.Equal(m.Name, tc.expName))
|
||||
|
|
|
@ -82,7 +82,8 @@ func TestParseMountSpec(t *testing.T) {
|
|||
tc := tc
|
||||
t.Run("", func(t *testing.T) {
|
||||
mp, err := parser.ParseMountSpec(tc.input)
|
||||
assert.Check(t, err)
|
||||
assert.NilError(t, err)
|
||||
|
||||
assert.Check(t, is.Equal(mp.Type, tc.expected.Type))
|
||||
assert.Check(t, is.Equal(mp.Destination, tc.expected.Destination))
|
||||
assert.Check(t, is.Equal(mp.Source, tc.expected.Source))
|
||||
|
|
|
@ -234,7 +234,7 @@ func TestWindowsParseMountRawSplit(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
assert.Check(t, err)
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Equal(m.Destination, tc.expDest))
|
||||
assert.Check(t, is.Equal(m.Source, tc.expSource))
|
||||
assert.Check(t, is.Equal(m.Name, tc.expName))
|
||||
|
|
|
@ -379,7 +379,7 @@ func setupTest(t *testing.T) (*VolumeStore, func()) {
|
|||
}
|
||||
|
||||
s, err := NewStore(dir, volumedrivers.NewStore(nil))
|
||||
assert.Check(t, err)
|
||||
assert.NilError(t, err)
|
||||
return s, func() {
|
||||
s.Shutdown()
|
||||
cleanup()
|
||||
|
|
Loading…
Add table
Reference in a new issue