fix assignments to_vool
This commit is contained in:
parent
e536a7ac88
commit
d14eca3e70
@ -23,8 +23,8 @@ module Ruby
|
|||||||
self.vool_brother.new(name,value)
|
self.vool_brother.new(name,value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_vool_send
|
def normalize_send
|
||||||
statements = value.normalize()
|
statements = value.to_vool
|
||||||
return copy( statements ) if statements.is_a?(Vool::SendStatement)
|
return copy( statements ) if statements.is_a?(Vool::SendStatement)
|
||||||
assign = statements.statements.pop
|
assign = statements.statements.pop
|
||||||
statements << copy(assign)
|
statements << copy(assign)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
|
|
||||||
module Ruby
|
module Ruby
|
||||||
class TestIvarAssignment < MiniTest::Test
|
class TestAssignment < MiniTest::Test
|
||||||
include RubyTests
|
include RubyTests
|
||||||
|
|
||||||
def test_local
|
def test_local
|
||||||
@ -12,7 +12,6 @@ module Ruby
|
|||||||
lst = compile( "foo = bar")
|
lst = compile( "foo = bar")
|
||||||
assert_equal :foo , lst.name
|
assert_equal :foo , lst.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_instance
|
def test_instance
|
||||||
lst = compile( "@foo = bar")
|
lst = compile( "@foo = bar")
|
||||||
assert_equal IvarAssignment , lst.class
|
assert_equal IvarAssignment , lst.class
|
||||||
@ -21,12 +20,33 @@ module Ruby
|
|||||||
lst = compile( "@foo = bar")
|
lst = compile( "@foo = bar")
|
||||||
assert_equal :foo , lst.name
|
assert_equal :foo , lst.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_const
|
def test_const
|
||||||
lst = compile( "@foo = 5")
|
lst = compile( "@foo = 5")
|
||||||
assert_equal IvarAssignment , lst.class
|
assert_equal IvarAssignment , lst.class
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
class TestAssignmentVool < MiniTest::Test
|
||||||
|
include RubyTests
|
||||||
|
|
||||||
|
def test_local
|
||||||
|
lst = compile( "foo = bar").to_vool
|
||||||
|
assert_equal Vool::LocalAssignment , lst.class
|
||||||
|
end
|
||||||
|
def test_local_name
|
||||||
|
lst = compile( "foo = bar").to_vool
|
||||||
|
assert_equal :foo , lst.name
|
||||||
|
end
|
||||||
|
def test_instance
|
||||||
|
lst = compile( "@foo = bar").to_vool
|
||||||
|
assert_equal Vool::IvarAssignment , lst.class
|
||||||
|
end
|
||||||
|
def test_instance_name
|
||||||
|
lst = compile( "@foo = bar").to_vool
|
||||||
|
assert_equal :foo , lst.name
|
||||||
|
end
|
||||||
|
def test_const
|
||||||
|
lst = compile( "@foo = 5").to_vool
|
||||||
|
assert_equal Vool::IvarAssignment , lst.class
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user