refactor: move test.php into testdata folder
This commit is contained in:
		
							parent
							
								
									86c10ca380
								
							
						
					
					
						commit
						ffc94c1a63
					
				| @ -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++ { | ||||
|  | ||||
| @ -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++ { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user