summaryrefslogtreecommitdiff
path: root/tests/test_helpers
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-05-09 15:42:57 +0200
committerJakob Unterwurzacher2020-05-09 15:42:57 +0200
commitc19baa10f8e8365ed9e3212a003a6b8f31f0320a (patch)
treedb21d3e3ce534742e03c3235614ae5ee8b0a7251 /tests/test_helpers
parent5dbf376860d51bac599064ad746ac94ade27c277 (diff)
tests: use t.Name()
We did not use t.Name() as it was not available before Go 1.8. Now the oldest Go version we support is Go 1.11, so we can use it.
Diffstat (limited to 'tests/test_helpers')
-rw-r--r--tests/test_helpers/helpers.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go
index bc5d275..93d34d6 100644
--- a/tests/test_helpers/helpers.go
+++ b/tests/test_helpers/helpers.go
@@ -125,7 +125,11 @@ func ResetTmpDir(createDirIV bool) {
//
// It returns cipherdir without a trailing slash.
func InitFS(t *testing.T, extraArgs ...string) string {
- dir, err := ioutil.TempDir(TmpDir, "")
+ prefix := "x."
+ if t != nil {
+ prefix = t.Name() + "."
+ }
+ dir, err := ioutil.TempDir(TmpDir, prefix)
if err != nil {
if t != nil {
t.Fatal(err)