mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 02:42:08 -05:00
hugofs: Add missing not nil checks to tests
This commit is contained in:
parent
b678e90db7
commit
c6c2c689d6
1 changed files with 8 additions and 0 deletions
|
@ -26,8 +26,11 @@ func TestInitDefault(t *testing.T) {
|
||||||
|
|
||||||
InitDefaultFs()
|
InitDefaultFs()
|
||||||
|
|
||||||
|
assert.NotNil(t, Source())
|
||||||
assert.IsType(t, new(afero.OsFs), Source())
|
assert.IsType(t, new(afero.OsFs), Source())
|
||||||
|
assert.NotNil(t, Destination())
|
||||||
assert.IsType(t, new(afero.OsFs), Destination())
|
assert.IsType(t, new(afero.OsFs), Destination())
|
||||||
|
assert.NotNil(t, Os())
|
||||||
assert.IsType(t, new(afero.OsFs), Os())
|
assert.IsType(t, new(afero.OsFs), Os())
|
||||||
assert.Nil(t, WorkingDir())
|
assert.Nil(t, WorkingDir())
|
||||||
}
|
}
|
||||||
|
@ -38,7 +41,9 @@ func TestInitMemFs(t *testing.T) {
|
||||||
|
|
||||||
InitMemFs()
|
InitMemFs()
|
||||||
|
|
||||||
|
assert.NotNil(t, Source())
|
||||||
assert.IsType(t, new(afero.MemMapFs), Source())
|
assert.IsType(t, new(afero.MemMapFs), Source())
|
||||||
|
assert.NotNil(t, Destination())
|
||||||
assert.IsType(t, new(afero.MemMapFs), Destination())
|
assert.IsType(t, new(afero.MemMapFs), Destination())
|
||||||
assert.IsType(t, new(afero.OsFs), Os())
|
assert.IsType(t, new(afero.OsFs), Os())
|
||||||
assert.Nil(t, WorkingDir())
|
assert.Nil(t, WorkingDir())
|
||||||
|
@ -49,6 +54,7 @@ func TestSetSource(t *testing.T) {
|
||||||
InitMemFs()
|
InitMemFs()
|
||||||
|
|
||||||
SetSource(new(afero.OsFs))
|
SetSource(new(afero.OsFs))
|
||||||
|
assert.NotNil(t, Source())
|
||||||
assert.IsType(t, new(afero.OsFs), Source())
|
assert.IsType(t, new(afero.OsFs), Source())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +63,7 @@ func TestSetDestination(t *testing.T) {
|
||||||
InitMemFs()
|
InitMemFs()
|
||||||
|
|
||||||
SetDestination(new(afero.OsFs))
|
SetDestination(new(afero.OsFs))
|
||||||
|
assert.NotNil(t, Destination())
|
||||||
assert.IsType(t, new(afero.OsFs), Destination())
|
assert.IsType(t, new(afero.OsFs), Destination())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,5 +75,6 @@ func TestWorkingDir(t *testing.T) {
|
||||||
|
|
||||||
InitMemFs()
|
InitMemFs()
|
||||||
|
|
||||||
|
assert.NotNil(t, WorkingDir())
|
||||||
assert.IsType(t, new(afero.BasePathFs), WorkingDir())
|
assert.IsType(t, new(afero.BasePathFs), WorkingDir())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue