mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +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"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
"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())
|
||||
}
|
||||
|
||||
if fi.Name() != filename {
|
||||
t.Errorf("Name() returned wrong value, want %q, got %q", filename, fi.Name())
|
||||
if path.Base(fi.Name()) != 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