mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
test: sanitize temp dir names since subtest names have slashes
This commit is contained in:
parent
2a39c480b9
commit
eded493206
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ func TempDir(t *testing.T, name string) string {
|
|||||||
if t != nil && t.Name() != "" {
|
if t != nil && t.Name() != "" {
|
||||||
name = t.Name() + "-" + name
|
name = t.Name() + "-" + name
|
||||||
}
|
}
|
||||||
|
name = strings.Replace(name, "/", "_", -1)
|
||||||
d, err := ioutil.TempDir(tmpdir, name)
|
d, err := ioutil.TempDir(tmpdir, name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user