shader: Bug fix: Test compile error

This commit is contained in:
Hajime Hoshi 2020-06-07 00:52:43 +09:00
parent ba36d5a8e9
commit 147c82f212

View File

@ -15,6 +15,8 @@
package shader_test
import (
"go/parser"
"go/token"
"testing"
. "github.com/hajimehoshi/ebiten/internal/shader"
@ -211,7 +213,14 @@ void main(void) {
}
for _, tc := range tests {
t.Run(tc.Name, func(t *testing.T) {
s, err := Compile([]byte(tc.Src), "Vertex", "Fragment")
fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "", []byte(tc.Src), parser.AllErrors)
if err != nil {
t.Fatal(err)
return
}
s, err := Compile(fset, f, "Vertex", "Fragment")
if err != nil {
t.Error(err)
return