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 ( import (
"io/ioutil" "io/ioutil"
"path/filepath"
"testing" "testing"
"github.com/VKCOM/php-parser/internal/php7" "github.com/VKCOM/php-parser/internal/php7"
@ -11,10 +12,9 @@ import (
) )
func BenchmarkPhp7(b *testing.B) { func BenchmarkPhp7(b *testing.B) {
src, err := ioutil.ReadFile("test.php") src, err := ioutil.ReadFile(filepath.Join("testdata", "test.php"))
if err != nil { 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++ { for n := 0; n < b.N; n++ {

View File

@ -2,6 +2,7 @@ package php8_test
import ( import (
"io/ioutil" "io/ioutil"
"path/filepath"
"testing" "testing"
"github.com/VKCOM/php-parser/internal/php8" "github.com/VKCOM/php-parser/internal/php8"
@ -10,10 +11,9 @@ import (
) )
func BenchmarkPhp8(b *testing.B) { func BenchmarkPhp8(b *testing.B) {
src, err := ioutil.ReadFile("test.php") src, err := ioutil.ReadFile(filepath.Join("testdata", "test.php"))
if err != nil { 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++ { for n := 0; n < b.N; n++ {