Skip to content

Commit

Permalink
test error
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleader committed Jan 5, 2024
1 parent 242c246 commit d1a6bd9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions loadfile/loadfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ func TestLoadContext(t *testing.T) {
neededFiles = []string{
dirpath,
}

errFileRead := "reading file"
ctxFiles, err := loadfile.LoadContext(neededFiles)
assert.Error(t, err)
assert.Contains(t, err.Error(), errFileRead)
assert.Equals(t, ctxFiles, nil)

// error on loading a symlink directory
Expand All @@ -73,6 +76,7 @@ func TestLoadContext(t *testing.T) {
}
ctxFiles, err = loadfile.LoadContext(neededFiles)
assert.Error(t, err)
assert.Contains(t, err.Error(), errFileRead)
assert.Equals(t, ctxFiles, nil)

t.Cleanup(func() {
Expand Down

0 comments on commit d1a6bd9

Please sign in to comment.