everything but dynamic dispatch
This commit is contained in:
@ -21,8 +21,7 @@ module Vool
|
||||
end
|
||||
|
||||
def test_compile_class_body
|
||||
assert_equal 0 , @lst.body.length
|
||||
assert_equal ScopeStatement , @lst.body.class
|
||||
assert_nil @lst.body
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -12,7 +12,7 @@ module Vool
|
||||
end
|
||||
def test_if_basic_cond
|
||||
lst = RubyCompiler.compile( basic_if )
|
||||
assert_equal SendStatement , lst.condition.class
|
||||
assert_equal ScopeStatement , lst.condition.class
|
||||
end
|
||||
def test_if_basic_branches
|
||||
lst = RubyCompiler.compile( basic_if )
|
||||
@ -29,7 +29,7 @@ module Vool
|
||||
end
|
||||
def test_if_double_cond
|
||||
lst = RubyCompiler.compile( double_if )
|
||||
assert_equal FalseConstant , lst.condition.class
|
||||
assert_equal ScopeStatement , lst.condition.class
|
||||
end
|
||||
def test_if_double_branches
|
||||
lst = RubyCompiler.compile( double_if )
|
||||
@ -63,7 +63,7 @@ module Vool
|
||||
end
|
||||
def test_if_reverse_cond
|
||||
lst = RubyCompiler.compile( reverse_unless )
|
||||
assert_equal FalseConstant , lst.condition.class
|
||||
assert_equal ScopeStatement , lst.condition.class
|
||||
end
|
||||
def test_if_reverse_branches
|
||||
lst = RubyCompiler.compile( reverse_unless )
|
||||
|
@ -32,9 +32,9 @@ module Vool
|
||||
assert_equal LocalAssignment , lst.body.class
|
||||
end
|
||||
def test_body_is_scope_zero_statement
|
||||
input = "def tryout(arg1, arg2) ; ; end "
|
||||
input = "def tryout(arg1, arg2) ; arg1 = arg2 ; end "
|
||||
lst = RubyCompiler.compile( input )
|
||||
assert_equal ScopeStatement , lst.body.class
|
||||
assert_equal LocalAssignment , lst.body.class
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -12,11 +12,11 @@ module Vool
|
||||
end
|
||||
def test_while_basic_cond
|
||||
lst = RubyCompiler.compile( basic_while )
|
||||
assert_equal SendStatement , lst.condition.class
|
||||
assert_equal ScopeStatement , lst.condition.class
|
||||
end
|
||||
def test_while_basic_branches
|
||||
lst = RubyCompiler.compile( basic_while )
|
||||
assert_equal TrueConstant , lst.statements.class
|
||||
assert_equal TrueConstant , lst.body.class
|
||||
end
|
||||
|
||||
def reverse_while
|
||||
@ -28,11 +28,11 @@ module Vool
|
||||
end
|
||||
def test_while_reverse_cond
|
||||
lst = RubyCompiler.compile( reverse_while )
|
||||
assert_equal FalseConstant , lst.condition.class
|
||||
assert_equal ScopeStatement , lst.condition.class
|
||||
end
|
||||
def test_while_reverse_branches
|
||||
lst = RubyCompiler.compile( reverse_while )
|
||||
assert_equal TrueConstant , lst.statements.class
|
||||
assert_equal TrueConstant , lst.body.class
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user