ebiten: Add a shader test

This commit is contained in:
Hajime Hoshi 2020-09-06 22:12:49 +09:00
parent e0b8b9945f
commit 0830e897fc

View File

@ -246,6 +246,19 @@ func TestShaderWrongReturn(t *testing.T) {
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
return 0.0;
}
`)); err == nil {
t.Errorf("error must be non-nil but was nil")
}
if _, err := NewShader([]byte(`package main
func Foo() (float, float) {
return 0;
}
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
return vec4(0);
}
`)); err == nil {
t.Errorf("error must be non-nil but was nil")
}