diff --git a/test/compiler/fragments/helper.rb b/test/compiler/fragments/helper.rb index 4d5316dc..0548822a 100644 --- a/test/compiler/fragments/helper.rb +++ b/test/compiler/fragments/helper.rb @@ -28,4 +28,9 @@ module Fragments assert_equal @stdout , @interpreter.stdout end + def check_return val + check + assert_equal Parfait::Message , @interpreter.get_register(:r1).class + assert_equal val , @interpreter.get_register(:r1).return_value + end end diff --git a/test/compiler/fragments/test_functions.rb b/test/compiler/fragments/test_functions.rb index cac6f8d8..e9e2b69e 100644 --- a/test/compiler/fragments/test_functions.rb +++ b/test/compiler/fragments/test_functions.rb @@ -19,8 +19,9 @@ class Object end int t_seven() - int tim = times(5,3) + int tim = times(8,10) tim.putint() + return tim end int main() @@ -28,8 +29,7 @@ class Object end end HERE - @length = 203 - check - + @length = 486 + check_return 80 end end diff --git a/test/compiler/fragments/test_if.rb b/test/compiler/fragments/test_if.rb index ec6a8efd..43e008a9 100644 --- a/test/compiler/fragments/test_if.rb +++ b/test/compiler/fragments/test_if.rb @@ -3,7 +3,7 @@ require_relative 'helper' class TestIf < MiniTest::Test include Fragments - def test_if_basic + def test_if_plus @string_input = <