Files
restic/internal/fs/node_linux_test.go
2025-10-03 19:10:39 +02:00

20 lines
526 B
Go

package fs
import (
"io/fs"
"strings"
"testing"
"github.com/restic/restic/internal/data"
"github.com/restic/restic/internal/errors"
rtest "github.com/restic/restic/internal/test"
)
func TestRestoreSymlinkTimestampsError(t *testing.T) {
d := t.TempDir()
node := data.Node{Type: data.NodeTypeSymlink}
err := nodeRestoreTimestamps(&node, d+"/nosuchfile")
rtest.Assert(t, errors.Is(err, fs.ErrNotExist), "want ErrNotExist, got %q", err)
rtest.Assert(t, strings.Contains(err.Error(), d), "filename not in %q", err)
}