2019-12-23 17:05:34 +03:00
|
|
|
package compiler_test
|
2018-04-02 17:04:42 +02:00
|
|
|
|
2019-08-20 20:37:06 +03:00
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
"testing"
|
|
|
|
)
|
2018-04-02 17:04:42 +02:00
|
|
|
|
|
|
|
var numericTestCases = []testCase{
|
|
|
|
{
|
|
|
|
"add",
|
|
|
|
`
|
|
|
|
package foo
|
|
|
|
func Main() int {
|
|
|
|
x := 2
|
|
|
|
y := 4
|
|
|
|
return x + y
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
big.NewInt(6),
|
|
|
|
},
|
|
|
|
}
|
2019-08-20 20:37:06 +03:00
|
|
|
|
|
|
|
func TestNumericExprs(t *testing.T) {
|
2019-10-18 18:36:54 +03:00
|
|
|
runTestCases(t, numericTestCases)
|
2019-08-20 20:37:06 +03:00
|
|
|
}
|