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