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