From 0830e897fc30f923982d5298edd24b0d4150e512 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 6 Sep 2020 22:12:49 +0900 Subject: [PATCH] ebiten: Add a shader test --- shader_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/shader_test.go b/shader_test.go index 1914a038b..19c3c8aec 100644 --- a/shader_test.go +++ b/shader_test.go @@ -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") }