Skip to content

Commit

Permalink
tests: check error returned by Walk
Browse files Browse the repository at this point in the history
  • Loading branch information
charlievieth committed Oct 25, 2024
1 parent aa71a4c commit 17800a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fastwalk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ func TestFastWalk_SortMode(t *testing.T) {
// only one directory, but use it for correctness.
var mu sync.Mutex
var got []string
fastwalk.Walk(&conf, tmp, func(path string, d fs.DirEntry, err error) error {
err := fastwalk.Walk(&conf, tmp, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand All @@ -1144,6 +1144,9 @@ func TestFastWalk_SortMode(t *testing.T) {
}
return nil
})
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(got, want) {
t.Errorf("Invalid output\ngot: %q\nwant: %q", got, want)
}
Expand Down

0 comments on commit 17800a2

Please sign in to comment.