36 lines
570 B
Go
36 lines
570 B
Go
package analyzer
|
|
|
|
import "testing"
|
|
|
|
func TestFunctionUniqueErr (test *testing.T) {
|
|
testStringErr (test,
|
|
"hello already declared at stream0.fspl:2:1", 3, 1,
|
|
`
|
|
[hello] = { }
|
|
[hello] = { }
|
|
`)
|
|
}
|
|
|
|
func TestFunctionUnique (test *testing.T) {
|
|
testString (test,
|
|
`
|
|
[hello] = { }
|
|
[world] = { }
|
|
`)
|
|
}
|
|
|
|
func TestFunctionArgumentUniqueErr (test *testing.T) {
|
|
testStringErr (test,
|
|
"x already listed as argument at stream0.fspl:2:7", 2, 13,
|
|
`
|
|
[main x:Int x:U8 y:Int] = { }
|
|
`)
|
|
}
|
|
|
|
func TestFunctionArgumentUnique (test *testing.T) {
|
|
testString (test,
|
|
`
|
|
[main x:Int y:U8 z:Int] = { }
|
|
`)
|
|
}
|