require_relative 'helper' module Register class TestWhile < MiniTest::Test include Statements def test_while_mini @string_input = < 0) n = n - 1 end end end HERE @expect = [[SaveReturn,LoadConstant,GetSlot,SetSlot],[GetSlot,GetSlot,LoadConstant,OperatorInstruction, IsZeroBranch,GetSlot,GetSlot,LoadConstant,OperatorInstruction,GetSlot,SetSlot,AlwaysBranch], [],[RegisterTransfer,GetSlot,FunctionReturn]] check end def test_while_return @string_input = < 5) n = n + 1 return n end end end HERE @expect = [[SaveReturn,LoadConstant,GetSlot,SetSlot], [GetSlot,GetSlot,LoadConstant,OperatorInstruction,IsZeroBranch,GetSlot, GetSlot,LoadConstant,OperatorInstruction,GetSlot,SetSlot,GetSlot, GetSlot,AlwaysBranch] , [],[RegisterTransfer,GetSlot,FunctionReturn]] check end end end