Add test cases for formatting nil type as Void

This commit is contained in:
Sasha Koshka 2024-02-12 14:47:09 -05:00
parent 3662bda3a8
commit f77f341c3d
1 changed files with 16 additions and 0 deletions

View File

@ -162,3 +162,19 @@ testString (test,
Bird: (~ [fly] [land])
`)
}
func TestTypeIntegerLiteralVoid (test *testing.T) {
testStringErr (test,
"cannot use integer literal as Void", 2, 10,
`
[main] = 5
`)
}
func TestTypeStringLiteralVoid (test *testing.T) {
testStringErr (test,
"cannot use string literal as Void", 2, 10,
`
[main] = 'hello'
`)
}