mirror of
https://github.com/octoleo/restic.git
synced 2024-12-04 19:03:46 +00:00
20 lines
532 B
Go
20 lines
532 B
Go
|
package fs
|
||
|
|
||
|
import (
|
||
|
"io/fs"
|
||
|
"strings"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/restic/restic/internal/errors"
|
||
|
"github.com/restic/restic/internal/restic"
|
||
|
rtest "github.com/restic/restic/internal/test"
|
||
|
)
|
||
|
|
||
|
func TestRestoreSymlinkTimestampsError(t *testing.T) {
|
||
|
d := t.TempDir()
|
||
|
node := restic.Node{Type: restic.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)
|
||
|
}
|