vis: refactored code to reflect using vis/unvis for file names
Added some more test cases for `vis`ing and `unvis`ing strings, and a test case that walks/checks a directory with filenames that require encoding. Had to change Path() to account for possible errors Unvis() could return. Refactored Vis()/Unvis() into go-mtree tar functionality as well. Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
parent
a63f83d94d
commit
773763fb87
12 changed files with 177 additions and 41 deletions
12
tar_test.go
12
tar_test.go
|
@ -119,12 +119,20 @@ func TestTar(t *testing.T) {
|
|||
errors += "Keyword validation errors\n"
|
||||
case len(res.Missing) > 0:
|
||||
for _, m := range res.Missing {
|
||||
t.Errorf("Missing file: %s\n", m.Path())
|
||||
missingpath, err := m.Path()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Errorf("Missing file: %s\n", missingpath)
|
||||
}
|
||||
errors += "Missing files not expected for this test\n"
|
||||
case len(res.Extra) > 0:
|
||||
for _, e := range res.Extra {
|
||||
t.Errorf("Extra file: %s\n", e.Path())
|
||||
extrapath, err := e.Path()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Errorf("Extra file: %s\n", extrapath)
|
||||
}
|
||||
errors += "Extra files not expected for this test\n"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue