aboutsummaryrefslogtreecommitdiff
path: root/tests/reverse/main_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-20 17:06:18 +0200
committerJakob Unterwurzacher2021-08-20 17:06:18 +0200
commitfbccb160438aba6f1e16b26a982122c726afee1a (patch)
tree1faac5ad3587a302fff40a8354382cda21823f3a /tests/reverse/main_test.go
parent14bf80301b4f3f1fb56f2f0b73de0dcc4aab5216 (diff)
-deterministic-names: implement for reverse mode, too
Diffstat (limited to 'tests/reverse/main_test.go')
-rw-r--r--tests/reverse/main_test.go23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/reverse/main_test.go b/tests/reverse/main_test.go
index 3425289..3b9e7d0 100644
--- a/tests/reverse/main_test.go
+++ b/tests/reverse/main_test.go
@@ -2,6 +2,7 @@ package reverse_test
import (
"bytes"
+ "fmt"
"os"
"testing"
@@ -9,8 +10,13 @@ import (
)
var x240 = string(bytes.Repeat([]byte("x"), 240))
+
+// plaintextnames is true when the currently running test has -plaintextnames active
var plaintextnames bool
+// deterministic_names is true when the currently running test has -deterministic-names active
+var deterministic_names bool
+
// dirA is a normal directory
var dirA string
@@ -24,10 +30,22 @@ var dirC string
// to "dirC".
func TestMain(m *testing.M) {
var r int
- for _, plaintextnames = range []bool{false, true} {
+
+ testcases := []struct {
+ plaintextnames bool
+ deterministic_names bool
+ }{
+ {false, false},
+ {true, false},
+ {false, true},
+ }
+ for i, tc := range testcases {
argsA := []string{"-reverse"}
- if plaintextnames {
+ plaintextnames, deterministic_names = tc.plaintextnames, tc.deterministic_names
+ if tc.plaintextnames {
argsA = append(argsA, "-plaintextnames")
+ } else if tc.deterministic_names {
+ argsA = append(argsA, "-deterministic-names")
}
dirA = test_helpers.InitFS(nil, argsA...)
dirB = test_helpers.TmpDir + "/b"
@@ -49,6 +67,7 @@ func TestMain(m *testing.M) {
os.RemoveAll(dirC)
if r != 0 {
+ fmt.Printf("testcases[%d] = %#v failed\n", i, tc)
os.Exit(r)
}
}