2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-29 15:10:49 +00:00

Skip /dev/null on darwin

This commit is contained in:
Alexander Neumann 2017-04-07 20:37:20 +02:00
parent 10a395ca33
commit db7e23b423

View File

@ -4,6 +4,7 @@ package restic
import (
"os"
"runtime"
"syscall"
"testing"
"time"
@ -81,15 +82,21 @@ func checkDevice(t testing.TB, stat *syscall.Stat_t, node *Node) {
}
func TestNodeFromFileInfo(t *testing.T) {
var tests = []struct {
type Test struct {
filename string
canSkip bool
}{
}
var tests = []Test{
{"node_test.go", false},
{"/dev/null", true},
{"/dev/sda", true},
}
// on darwin, users are not permitted to list the extended attributes of
// /dev/null, therefore skip it.
if runtime.GOOS != "darwin" {
tests = append(tests, Test{"/dev/null", true})
}
for _, test := range tests {
t.Run("", func(t *testing.T) {
fi, found := stat(t, test.filename)