optimizations
This commit is contained in:
@@ -257,6 +257,24 @@ func TestFloatingPointArithmetic(t *testing.T) {
|
||||
runVmTests(t, tests)
|
||||
}
|
||||
|
||||
func TestMixedArithmetic(t *testing.T) {
|
||||
tests := []vmTestCase{
|
||||
{"1 + 2.1", 3.1},
|
||||
{"2 - 0.5", 1.5},
|
||||
{"2 * 2.5", 5.0},
|
||||
{"5 / 2.0", 2.5},
|
||||
{"5 % 2.0", 1.0},
|
||||
|
||||
{"2.1 + 1", 3.1},
|
||||
{"2.5 - 2", 0.5},
|
||||
{"2.5 * 2", 5.0},
|
||||
{"5.0 / 2", 2.5},
|
||||
{"5.0 % 2", 1.0},
|
||||
}
|
||||
|
||||
runVmTests(t, tests)
|
||||
}
|
||||
|
||||
func TestBooleanExpressions(t *testing.T) {
|
||||
tests := []vmTestCase{
|
||||
{"true", true},
|
||||
|
||||
Reference in New Issue
Block a user