mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-07-01 05:28:30 +00:00
check: functionality for symlinks
Default behavior (according to upstream mtree) for validating symlinks is to just validate the link itself, not to follow it. Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
parent
d6b0881515
commit
2facedc401
16 changed files with 41 additions and 9 deletions
|
@ -97,6 +97,24 @@ func ExampleCheck() {
|
|||
}
|
||||
}
|
||||
|
||||
// Tests default action for evaluating a symlink, which is just to compare the
|
||||
// link itself, not to follow it
|
||||
func TestDefaultBrokenLink(t *testing.T) {
|
||||
dh, err := Walk("./testdata/dirwithbrokenlink", nil, append(DefaultKeywords, "sha1"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
res, err := Check("./testdata/dirwithbrokenlink", dh, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if res != nil && len(res.Failures) > 0 {
|
||||
for _, f := range res.Failures {
|
||||
t.Error(f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/vbatts/go-mtree/issues/8
|
||||
func TestTimeComparison(t *testing.T) {
|
||||
dir, err := ioutil.TempDir("", "test-time.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue