mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: Add more tests (ShaderUnmatchedArgs)
This commit is contained in:
parent
8ae6793d4d
commit
d9c362bca9
@ -1191,6 +1191,53 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
Foo(1)
|
||||
return position
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Errorf("error must be non-nil but was nil")
|
||||
}
|
||||
|
||||
if _, err := ebiten.NewShader([]byte(`package main
|
||||
|
||||
func Foo(x float) {
|
||||
}
|
||||
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
Foo()
|
||||
return position
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Errorf("error must be non-nil but was nil")
|
||||
}
|
||||
|
||||
if _, err := ebiten.NewShader([]byte(`package main
|
||||
|
||||
func Foo(x, y float) {
|
||||
}
|
||||
|
||||
func Bar() (float, float, float) {
|
||||
return 0, 1
|
||||
}
|
||||
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
Foo(Bar())
|
||||
return position
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Errorf("error must be non-nil but was nil")
|
||||
}
|
||||
|
||||
if _, err := ebiten.NewShader([]byte(`package main
|
||||
|
||||
func Foo(x, y, z float) {
|
||||
}
|
||||
|
||||
func Bar() (float, float) {
|
||||
return 0, 1
|
||||
}
|
||||
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
Foo(Bar())
|
||||
return position
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Errorf("error must be non-nil but was nil")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user