diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-10-08 23:04:00 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-01-24 17:39:46 +0300 |
commit | 3c8b844011a8a7cf18c7589900ba7f12b2ebf570 (patch) | |
tree | 925d6dbeafb06f18a045d0574b8c4487f79797a7 /internal/redirects | |
parent | 136471e8d5a582236fb0f9565da3b0114a048b1e (diff) |
test: replace tmpdir workaround with native T tmp
Diffstat (limited to 'internal/redirects')
-rw-r--r-- | internal/redirects/redirects_benchmark_test.go | 4 | ||||
-rw-r--r-- | internal/redirects/redirects_test.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/redirects/redirects_benchmark_test.go b/internal/redirects/redirects_benchmark_test.go index 1e679785..f02eb679 100644 --- a/internal/redirects/redirects_benchmark_test.go +++ b/internal/redirects/redirects_benchmark_test.go @@ -31,7 +31,7 @@ func generateRedirectsFile(dirPath string, count int) error { func benchmarkRedirectsRewrite(b *testing.B, redirectsCount int) { ctx := context.Background() - root, tmpDir := testhelpers.TmpDir(b, "ParseRedirects_benchmarks") + root, tmpDir := testhelpers.TmpDir(b) err := generateRedirectsFile(tmpDir, redirectsCount) require.NoError(b, err) @@ -65,7 +65,7 @@ func BenchmarkRedirectsRewrite_PlaceholdersEnabled(b *testing.B) { func benchmarkRedirectsParseRedirects(b *testing.B, redirectsCount int) { ctx := context.Background() - root, tmpDir := testhelpers.TmpDir(b, "ParseRedirects_benchmarks") + root, tmpDir := testhelpers.TmpDir(b) err := generateRedirectsFile(tmpDir, redirectsCount) require.NoError(b, err) diff --git a/internal/redirects/redirects_test.go b/internal/redirects/redirects_test.go index b51043f7..5fdf8325 100644 --- a/internal/redirects/redirects_test.go +++ b/internal/redirects/redirects_test.go @@ -157,7 +157,7 @@ func TestRedirectsRewrite(t *testing.T) { func TestRedirectsParseRedirects(t *testing.T) { ctx := context.Background() - root, tmpDir := testhelpers.TmpDir(t, "ParseRedirects_tests") + root, tmpDir := testhelpers.TmpDir(t) tests := []struct { name string @@ -220,7 +220,7 @@ func TestRedirectsParseRedirects(t *testing.T) { } func TestMaxRuleCount(t *testing.T) { - root, tmpDir := testhelpers.TmpDir(t, "TooManyRules_tests") + root, tmpDir := testhelpers.TmpDir(t) err := os.WriteFile(path.Join(tmpDir, ConfigFile), []byte(strings.Repeat("/goto.html /target.html 301\n", maxRuleCount-1)+ "/1000.html /target1000 301\n"+ |