optimizations
This commit is contained in:
@@ -242,6 +242,21 @@ func TestIntegerArithmetic(t *testing.T) {
|
||||
runVmTests(t, tests)
|
||||
}
|
||||
|
||||
func TestFloatingPointArithmetic(t *testing.T) {
|
||||
tests := []vmTestCase{
|
||||
{"1.2", 1.2},
|
||||
{"2.3", 2.3},
|
||||
{"1.2 + 2.3", 3.5},
|
||||
{"1.2 - 2.4", -1.2},
|
||||
{"1.2 * 2.4", 2.88},
|
||||
{"5.0 / 2.0", 2.5},
|
||||
{"-2.5", -2.5},
|
||||
{"!1.0", false},
|
||||
}
|
||||
|
||||
runVmTests(t, tests)
|
||||
}
|
||||
|
||||
func TestBooleanExpressions(t *testing.T) {
|
||||
tests := []vmTestCase{
|
||||
{"true", true},
|
||||
|
||||
Reference in New Issue
Block a user