mirror of
https://github.com/octoleo/restic.git
synced 2024-11-29 16:23:59 +00:00
fs: Add file info base name check in reader tests (#2063)
This commit is contained in:
parent
5096f3b491
commit
f7f14cf8c9
@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -163,8 +164,12 @@ func checkFileInfo(t testing.TB, fi os.FileInfo, filename string, modtime time.T
|
|||||||
t.Errorf("ModTime() returned wrong value, want %v, got %v", modtime, fi.ModTime())
|
t.Errorf("ModTime() returned wrong value, want %v, got %v", modtime, fi.ModTime())
|
||||||
}
|
}
|
||||||
|
|
||||||
if fi.Name() != filename {
|
if path.Base(fi.Name()) != fi.Name() {
|
||||||
t.Errorf("Name() returned wrong value, want %q, got %q", filename, fi.Name())
|
t.Errorf("Name() returned is not base, want %q, got %q", path.Base(fi.Name()), fi.Name())
|
||||||
|
}
|
||||||
|
|
||||||
|
if fi.Name() != path.Base(filename) {
|
||||||
|
t.Errorf("Name() returned wrong value, want %q, got %q", path.Base(filename), fi.Name())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user