refactor: move test.php into testdata folder

This commit is contained in:
Laytan Laats 2023-03-25 14:32:14 +01:00
parent 86c10ca380
commit ffc94c1a63
4 changed files with 6 additions and 6 deletions

View File

@ -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++ {

View File

@ -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++ {