ebiten: Add shader tests

This commit is contained in:
Hajime Hoshi 2020-09-14 00:21:40 +09:00
parent 7666987b09
commit 3421598e64

View File

@ -415,6 +415,30 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
_ = x
return vec4(0)
}
`)); err == nil {
t.Errorf("error must be non-nil but was nil")
}
if _, err := NewShader([]byte(`package main
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
var x [4]float
y := x[1:2]
_ = y
return vec4(0)
}
`)); err == nil {
t.Errorf("error must be non-nil but was nil")
}
if _, err := NewShader([]byte(`package main
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
var x [4]float
y := x[1:2:3]
_ = y
return vec4(0)
}
`)); err == nil {
t.Errorf("error must be non-nil but was nil")
}