diff --git a/test/risc/interpreter/test_simple_if10.rb b/test/risc/interpreter/test_simple_if10.rb new file mode 100644 index 00000000..f4c2f648 --- /dev/null +++ b/test/risc/interpreter/test_simple_if10.rb @@ -0,0 +1,31 @@ +require_relative "helper" + +module Risc + class InterreterSimpleIf10 < MiniTest::Test + include Ticker + + def setup + @string_input = as_main 'if( 10 ); return "then";else;return "else";end' + super + end + + def test_if + #show_ticks # get output of what is + check_chain [Branch, Label, LoadConstant, SlotToReg, LoadConstant, + SlotToReg, SlotToReg, RegToSlot, LoadConstant, SlotToReg, + SlotToReg, SlotToReg, SlotToReg, RegToSlot, LoadConstant, + SlotToReg, SlotToReg, SlotToReg, SlotToReg, RegToSlot, + SlotToReg, RegToSlot, LoadConstant, RegToSlot, FunctionCall, + Label, LoadConstant, LoadConstant, OperatorInstruction, IsNotZero, + Label, LoadConstant, RegToSlot, SlotToReg, SlotToReg, + RegToSlot, SlotToReg, SlotToReg, FunctionReturn, Transfer, + Syscall, NilClass] + assert_equal Parfait::Word , get_return.class + assert_equal "else" , get_return.to_string + end + def test_exit + done = ticks(41) + assert_equal Syscall , done.class + end + end +end diff --git a/test/risc/interpreter/wip/test_simple_if.rb b/test/risc/interpreter/wip/test_simple_if.rb deleted file mode 100644 index d7aaab67..00000000 --- a/test/risc/interpreter/wip/test_simple_if.rb +++ /dev/null @@ -1,42 +0,0 @@ -require_relative "../helper" - -module Risc - class IfSimpleTest < MiniTest::Test - include Ticker - include CleanCompile - - def setup - @string_input = <