mirror of
https://github.com/restic/restic.git
synced 2026-10-30 20:15:43 +00:00
restic: extract Node filesystem code to fs package
This commit is contained in:
1 parent
a2e54eac64
commit
b9b32e5647
26 files changed
+783
-752
No files matched your search
@@ -0,0 +1,28 @@
|
||||
//go:build darwin || freebsd || linux || solaris
|
||||
// +build darwin freebsd linux solaris
|
||||
|
||||
package fs
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/xattr"
|
||||
rtest "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestIsListxattrPermissionError(t *testing.T) {
|
||||
xerr := &xattr.Error{
|
||||
Op: "xattr.list",
|
||||
Name: "test",
|
||||
Err: os.ErrPermission,
|
||||
}
|
||||
err := handleXattrErr(xerr)
|
||||
rtest.Assert(t, err != nil, "missing error")
|
||||
rtest.Assert(t, IsListxattrPermissionError(err), "expected IsListxattrPermissionError to return true for %v", err)
|
||||
|
||||
xerr.Err = os.ErrNotExist
|
||||
err = handleXattrErr(xerr)
|
||||
rtest.Assert(t, err != nil, "missing error")
|
||||
rtest.Assert(t, !IsListxattrPermissionError(err), "expected IsListxattrPermissionError to return false for %v", err)
|
||||
}
|
||||
Reference in new issue
Block a user