Fix if statements hoisting, now that send is working

Same same, just have to remembe to actually execute the condition if it is a send
Having send a possible expression, removes one tmp variable and associated move, for a little extra work.
Next return and assign (rest)
This commit is contained in:
2019-08-16 18:42:57 +03:00
parent dee1e24c28
commit e6c30d98fb
11 changed files with 80 additions and 37 deletions

View File

@ -1,7 +1,7 @@
require_relative "helper"
module Ruby
class TestAssignment < MiniTest::Test
class TestAssignmentRuby < MiniTest::Test
include RubyTests
def test_local
@ -25,11 +25,14 @@ module Ruby
assert_equal IvarAssignment , lst.class
end
end
class TestAssignmentVoolBar < MiniTest::Test
class TestAssignmentVoolLocal < MiniTest::Test
include RubyTests
def setup
@lst = compile( "foo = bar").to_vool
end
def test_tos
assert_equal "foo = self.bar()" , @lst.to_s
end
def test_local
assert_equal Vool::LocalAssignment , @lst.class
end
@ -45,6 +48,9 @@ module Ruby
def setup
@lst = compile( "@foo = bar").to_vool
end
def test_tos
assert_equal "@foo = self.bar()" , @lst.to_s
end
def test_instance
assert_equal Vool::IvarAssignment , @lst.class
end