Add problematic multiunit test case from #49

This commit is contained in:
Sasha Koshka 2024-02-27 03:06:54 -05:00
parent e5344c034b
commit b3ae80e809
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package generator
import "testing"
func TestUnitWriterInterface (test *testing.T) {
testUnits (test,
`
`,
`[sayHello writer:io::Writer] = writer.[write 'well hello their\n']
[main]: I32 'main' = {
stdout:io::File = 1
[sayHello stdout]
0
}`,
"cstdio.fspl",
`+ FileDescriptor: Int
+ [write file:FileDescriptor buffer:*Byte count:Index]: Index 'write'`,
"io.fspl",
`+ Writer: (~ [write buffer:*:Byte]: Index)
+ File: cstdio::FileDescriptor
+ File.[write buffer:*:Byte]:Index =
cstdio::[write
[~cstdio::FileDescriptor [.this]]
[~*Byte buffer] [#buffer]]`,
)}