diff --git a/lib/risc/instructions/branch.rb b/lib/risc/instructions/branch.rb index 66e12420..23fae388 100644 --- a/lib/risc/instructions/branch.rb +++ b/lib/risc/instructions/branch.rb @@ -31,7 +31,7 @@ module Risc end end - # dynamic version of an Branch branch that jumps to the contents + # dynamic version of an Branch that jumps to the contents # of a register instead of a hardcoded address # As Branches jump to Labels, this is not derived from Branch # PS: to conditionally jump to a dynamic adddress we do a normal branch diff --git a/test/risc/interpreter/builtin/test_int_cmp.rb b/test/risc/interpreter/builtin/test_int_cmp.rb index 7e148738..732b4abd 100644 --- a/test/risc/interpreter/builtin/test_int_cmp.rb +++ b/test/risc/interpreter/builtin/test_int_cmp.rb @@ -1,6 +1,5 @@ require_relative "../helper" -# TODO move these to interpreter dir module Risc module Macro class IntCmp < Minitest::Test diff --git a/test/rubyx/rt_parfait/test_object.rb b/test/rubyx/rt_parfait/test_object.rb index 24c21a80..d645a014 100644 --- a/test/rubyx/rt_parfait/test_object.rb +++ b/test/rubyx/rt_parfait/test_object.rb @@ -1,12 +1,11 @@ require_relative "rt_helper" module RubyX - class ObjectTest < MiniTest::Test + class ObjectSourceTest < MiniTest::Test include ParfaitHelper def setup @input = load_parfait(:object) + load_parfait_test(:object) end - def test_load assert @input.include? "ParfaitTest" assert @input.include? "class Object" @@ -41,16 +40,41 @@ module RubyX assert_equal Vool::ClassExpression , vool[2].class assert_equal :TestObject , vool[2].name end - - def est_basics - risc = compiler.ruby_to_risc @input , :interpreter - assert_equal Risc::Linker , risc.class - end - - def test_run_all - @input = "class Space;def main(arg); return 'hi';end;end;" + @input - run_input - assert_equal "" , @interpreter.stdout + def test_vool_methods + vool = Ruby::RubyCompiler.compile(@input).to_vool + assert_equal Vool::Statements , vool[2].body.class + vool[2].body.statements.each do |st| + assert_equal Vool::MethodExpression , st.class + end end end + class TestObjectRtTest < Minitest::Test + self.class.include ParfaitHelper + include Risc::Ticker + + def self.runnable_methods + input = load_parfait(:object) + load_parfait_test(:object) + vool = Ruby::RubyCompiler.compile(input).to_vool + tests = [ ] + vool[2].body.statements.each do |method| + tests << method.name + self.send(:define_method, method.name ) do + code = input + <