Add same test as stub to generator
This commit is contained in:
parent
e6bc09e622
commit
2571fcde99
@ -105,6 +105,22 @@ Number.[number]: Int = [.this]
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMethodChained (test *testing.T) {
|
||||||
|
testString (test,
|
||||||
|
`
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
Number: Int
|
||||||
|
|
||||||
|
Number.[add x:Number]:Number = [+ [.this] x]
|
||||||
|
Number.[sub x:Number]:Number = [- [.this] x]
|
||||||
|
Number.[mul x:Number]:Number = [* [.this] x]
|
||||||
|
Number.[div x:Number]:Number = [/ [.this] x]
|
||||||
|
|
||||||
|
[main]: Number = [~Number 5].[add 8].[mul 3]
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
func TestMethodGreeter (test *testing.T) {
|
func TestMethodGreeter (test *testing.T) {
|
||||||
testString (test,
|
testString (test,
|
||||||
`%Index = type i64
|
`%Index = type i64
|
||||||
|
Loading…
Reference in New Issue
Block a user