Skip to content

Commit

Permalink
internal/shader: add more tests
Browse files Browse the repository at this point in the history
Updates #3011
  • Loading branch information
hajimehoshi committed Aug 3, 2024
1 parent 7c4f532 commit af6072c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions internal/shader/syntax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4368,6 +4368,16 @@ func TestSyntaxIndex(t *testing.T) {
// Issue #3011
if _, err := compileToIR([]byte(`package main
func Foo() float {
var a int
var b vec4
return b[a]
}
`)); err == nil {
t.Error("compileToIR must return an error but did not")
}
if _, err := compileToIR([]byte(`package main
func Foo() int {
var a int
var b ivec4
Expand All @@ -4388,6 +4398,16 @@ func Foo() float {
}
if _, err := compileToIR([]byte(`package main
func Foo() float {
const a = 0
var b vec4
return b[a]
}
`)); err != nil {
t.Error(err)
}
if _, err := compileToIR([]byte(`package main
func Foo() int {
const a = 0
var b ivec4
Expand Down

0 comments on commit af6072c

Please sign in to comment.