method tests working again
This commit is contained in:
@ -16,8 +16,7 @@ module Vool
|
||||
|
||||
def test_method_has_source
|
||||
method = create_method
|
||||
assert_equal ScopeStatement , method.source.class
|
||||
assert_equal IvarAssignment , method.source.statements.first.class
|
||||
assert_equal IvarAssignment , method.source.class
|
||||
end
|
||||
|
||||
def test_method_has_no_locals
|
||||
@ -38,22 +37,22 @@ module Vool
|
||||
|
||||
def test_creates_method_statement_in_class
|
||||
clazz = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5 ;end")
|
||||
assert_equal MethodStatement , clazz.body.statements.first.class
|
||||
end
|
||||
|
||||
def test_parfait_class_creation
|
||||
clazz = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
|
||||
assert_equal Parfait::Class , clazz.body.statements.first.clazz.class
|
||||
assert_equal MethodStatement , clazz.body.class
|
||||
end
|
||||
|
||||
def test_method_statement_has_class
|
||||
clazz = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
|
||||
assert clazz.body.statements.first.clazz
|
||||
assert clazz.body.clazz
|
||||
end
|
||||
|
||||
def test_parfait_class_creation
|
||||
clazz = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
|
||||
assert_equal Parfait::Class , clazz.body.clazz.class
|
||||
end
|
||||
|
||||
def test_method_statement_has_class_in_main
|
||||
clazz = VoolCompiler.ruby_to_vool as_main("def meth; @ivar = 5;end")
|
||||
assert clazz.body.statements.first.clazz
|
||||
clazz = VoolCompiler.ruby_to_vool in_Space("def meth; @ivar = 5;end")
|
||||
assert clazz.body.clazz
|
||||
end
|
||||
|
||||
def test_method_has_one_local
|
||||
|
@ -8,14 +8,13 @@ module Vool
|
||||
|
||||
def setup
|
||||
Risc.machine.boot
|
||||
@stats = compile_first_method( "5.mod4").first
|
||||
@first = @stats.first
|
||||
@ins = compile_first_method( "5.mod4")
|
||||
end
|
||||
def receiver
|
||||
[Mom::IntegerConstant , 5]
|
||||
end
|
||||
def test_call_has_right_method
|
||||
assert_equal :mod4, @stats[2].method.name
|
||||
assert_equal :mod4, @ins.next(3).method.name
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user