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