all: use tstest.Replace more

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-03-04 12:04:55 -08:00
committed by Maisem Ali
parent 57a44846ae
commit 1a30b2d73f
12 changed files with 35 additions and 58 deletions

View File

@@ -13,6 +13,7 @@ import (
"testing"
"go4.org/mem"
"tailscale.com/tstest"
)
func TestWalkShallowOSSpecific(t *testing.T) {
@@ -28,9 +29,7 @@ func TestWalkShallowPortable(t *testing.T) {
func testWalkShallow(t *testing.T, portable bool) {
if portable {
old := osWalkShallow
defer func() { osWalkShallow = old }()
osWalkShallow = nil
tstest.Replace(t, &osWalkShallow, nil)
}
d := t.TempDir()