Torsten Rüger
d1f8733623
Simple is really the descriptive name for the layer Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified) Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else Just cause i was renaming anyway
42 lines
1.1 KiB
Ruby
42 lines
1.1 KiB
Ruby
require_relative 'helper'
|
|
|
|
module Ruby
|
|
class TestWhileStatementSol < MiniTest::Test
|
|
include RubyTests
|
|
def setup
|
|
@lst = compile( "while(@arg) ; @arg = 1 ; end" ).to_sol
|
|
end
|
|
def test_class
|
|
assert_equal Sol::WhileStatement , @lst.class
|
|
end
|
|
def test_body_class
|
|
assert_equal Sol::IvarAssignment , @lst.body.class
|
|
end
|
|
def test_condition_class
|
|
assert_equal Sol::InstanceVariable , @lst.condition.class
|
|
end
|
|
def test_no_hoist
|
|
assert_nil @lst.hoisted
|
|
end
|
|
end
|
|
class TestWhileStatementHoist < MiniTest::Test
|
|
include RubyTests
|
|
def setup
|
|
@lst = compile( "while(call(arg > 1)) ; arg = 1 ; end" ).to_sol
|
|
end
|
|
def test_class
|
|
assert_equal Sol::WhileStatement , @lst.class
|
|
assert_equal Sol::LocalAssignment , @lst.body.class
|
|
end
|
|
def test_condition_class
|
|
assert_equal Sol::SendStatement , @lst.condition.class
|
|
end
|
|
def test_hoist
|
|
assert_equal Sol::Statements , @lst.hoisted.class
|
|
end
|
|
def test_hoist_is_assi
|
|
assert_equal Sol::LocalAssignment , @lst.hoisted.first.class
|
|
end
|
|
end
|
|
end
|