Close out the repository audit
This commit is contained in:
25
internal/testutil/symlink_test.go
Normal file
25
internal/testutil/symlink_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io/fs"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSymlinkUnavailableClassifiesOnlyCapabilityErrors(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
err error
|
||||
want bool
|
||||
}{
|
||||
{name: "permission", err: fs.ErrPermission, want: true},
|
||||
{name: "unsupported", err: errors.ErrUnsupported, want: true},
|
||||
{name: "unexpected", err: errors.New("fixture path is invalid"), want: false},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
if got := symlinkUnavailable(test.err); got != test.want {
|
||||
t.Fatalf("symlinkUnavailable(%v) = %t, want %t", test.err, got, test.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user