From ffc94c1a63eeec25fbd4f5896ef182ae0da7b836 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Sat, 25 Mar 2023 14:32:14 +0100 Subject: [PATCH] refactor: move test.php into testdata folder --- internal/php7/php7_bench_test.go | 6 +++--- internal/php7/{ => testdata}/test.php | 0 internal/php8/php8_bench_test.go | 6 +++--- internal/php8/{ => testdata}/test.php | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename internal/php7/{ => testdata}/test.php (100%) rename internal/php8/{ => testdata}/test.php (100%) diff --git a/internal/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go index a22a6ab..5d9ddd4 100644 --- a/internal/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -2,6 +2,7 @@ package php7_test import ( "io/ioutil" + "path/filepath" "testing" "github.com/VKCOM/php-parser/internal/php7" @@ -11,10 +12,9 @@ import ( ) func BenchmarkPhp7(b *testing.B) { - src, err := ioutil.ReadFile("test.php") - + src, err := ioutil.ReadFile(filepath.Join("testdata", "test.php")) if err != nil { - b.Fatal("can not read test.php: " + err.Error()) + b.Fatal("can not read testdata/test.php: " + err.Error()) } for n := 0; n < b.N; n++ { diff --git a/internal/php7/test.php b/internal/php7/testdata/test.php similarity index 100% rename from internal/php7/test.php rename to internal/php7/testdata/test.php diff --git a/internal/php8/php8_bench_test.go b/internal/php8/php8_bench_test.go index caf2ca8..bc44c91 100644 --- a/internal/php8/php8_bench_test.go +++ b/internal/php8/php8_bench_test.go @@ -2,6 +2,7 @@ package php8_test import ( "io/ioutil" + "path/filepath" "testing" "github.com/VKCOM/php-parser/internal/php8" @@ -10,10 +11,9 @@ import ( ) func BenchmarkPhp8(b *testing.B) { - src, err := ioutil.ReadFile("test.php") - + src, err := ioutil.ReadFile(filepath.Join("testdata", "test.php")) if err != nil { - b.Fatal("can not read test.php: " + err.Error()) + b.Fatal("can not read testdata/test.php: " + err.Error()) } for n := 0; n < b.N; n++ { diff --git a/internal/php8/test.php b/internal/php8/testdata/test.php similarity index 100% rename from internal/php8/test.php rename to internal/php8/testdata/test.php