diff options
| author | Bryan C. Mills <bcmills@google.com> | 2020-05-19 14:17:05 -0400 |
|---|---|---|
| committer | Bryan C. Mills <bcmills@google.com> | 2020-05-19 18:43:29 +0000 |
| commit | 2dbbc867dbf44f72422d1827d18a2055f9b7b72f (patch) | |
| tree | bf97d3bc685d184b1bdc889f1dd081e9f4fcd10e | |
| parent | 6d6e4827c0b8ce302f7815ab565617f4593c5b46 (diff) | |
| download | go-2dbbc867dbf44f72422d1827d18a2055f9b7b72f.tar.xz | |
crypto/x509: save the temp dir in TestReadUniqueDirectoryEntries
In CL 231958, TempDir was changed to create a new temp directory on
each allocation, on the theory that it is easy to save in a variable
for callers that want the same directory repeatedly. Apply that
transformation here.
Updates #38850
Change-Id: Ibb014095426c33038e0a2c95303579cf95d5c3ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/234582
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
| -rw-r--r-- | src/crypto/x509/root_unix_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/crypto/x509/root_unix_test.go b/src/crypto/x509/root_unix_test.go index 39556ae60d..5a8015429c 100644 --- a/src/crypto/x509/root_unix_test.go +++ b/src/crypto/x509/root_unix_test.go @@ -204,7 +204,8 @@ func TestLoadSystemCertsLoadColonSeparatedDirs(t *testing.T) { } func TestReadUniqueDirectoryEntries(t *testing.T) { - temp := func(base string) string { return filepath.Join(t.TempDir(), base) } + tmp := t.TempDir() + temp := func(base string) string { return filepath.Join(tmp, base) } if f, err := os.Create(temp("file")); err != nil { t.Fatal(err) } else { @@ -216,7 +217,7 @@ func TestReadUniqueDirectoryEntries(t *testing.T) { if err := os.Symlink("../target-out", temp("link-out")); err != nil { t.Fatal(err) } - got, err := readUniqueDirectoryEntries(t.TempDir()) + got, err := readUniqueDirectoryEntries(tmp) if err != nil { t.Fatal(err) } |
