mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +01:00
shader: Bug fix: Test compile error
This commit is contained in:
parent
ba36d5a8e9
commit
147c82f212
@ -15,6 +15,8 @@
|
|||||||
package shader_test
|
package shader_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"go/parser"
|
||||||
|
"go/token"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
. "github.com/hajimehoshi/ebiten/internal/shader"
|
. "github.com/hajimehoshi/ebiten/internal/shader"
|
||||||
@ -211,7 +213,14 @@ void main(void) {
|
|||||||
}
|
}
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
t.Run(tc.Name, func(t *testing.T) {
|
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 {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user