diff --git a/lib/slot_machine/macro/operator.rb b/lib/slot_machine/macro/operator.rb index 66eeb3b7..62044b7e 100644 --- a/lib/slot_machine/macro/operator.rb +++ b/lib/slot_machine/macro/operator.rb @@ -3,7 +3,7 @@ module SlotMachine attr_reader :operator def initialize(name , operator) super(name) - @operator = operator.value + @operator = operator end def to_risc(compiler) diff --git a/test/risc/test_linker.rb b/test/risc/binary/test_linker.rb similarity index 100% rename from test/risc/test_linker.rb rename to test/risc/binary/test_linker.rb diff --git a/test/risc/test_linker1.rb b/test/risc/binary/test_linker1.rb similarity index 100% rename from test/risc/test_linker1.rb rename to test/risc/binary/test_linker1.rb diff --git a/test/risc/test_text_writer.rb b/test/risc/binary/test_text_writer.rb similarity index 100% rename from test/risc/test_text_writer.rb rename to test/risc/binary/test_text_writer.rb diff --git a/test/risc/interpreter/conditional/test_if_constant.rb b/test/risc/interpreter/conditional/test_if_constant.rb index ac78776b..363b0f73 100644 --- a/test/risc/interpreter/conditional/test_if_constant.rb +++ b/test/risc/interpreter/conditional/test_if_constant.rb @@ -11,10 +11,10 @@ module Risc def test_if #show_main_ticks # get output of what is in main - check_main_chain [LoadConstant, LoadConstant, OperatorInstruction, IsZero, LoadConstant, #5 + check_main_chain [LoadConstant, LoadConstant, OperatorInstruction, IsZero, LoadConstant, #5 OperatorInstruction, IsZero, LoadConstant, RegToSlot, Branch, #10 SlotToReg, SlotToReg, RegToSlot, SlotToReg, SlotToReg, #15 - SlotToReg, FunctionReturn, Transfer, SlotToReg, SlotToReg, #20 + FunctionReturn, Transfer, SlotToReg, SlotToReg, Transfer, #20 Syscall, NilClass,] #25 assert_equal 1 , get_return end diff --git a/test/risc/interpreter/while/test_while_simple.rb b/test/risc/interpreter/while/test_while_simple.rb index d0093961..e6119cbd 100644 --- a/test/risc/interpreter/while/test_while_simple.rb +++ b/test/risc/interpreter/while/test_while_simple.rb @@ -15,10 +15,10 @@ module Risc IsZero, LoadConstant, OperatorInstruction, IsZero, LoadConstant, #10 RegToSlot, Branch, SlotToReg, LoadConstant, OperatorInstruction, #15 IsZero, SlotToReg, RegToSlot, Branch, SlotToReg, #20 - SlotToReg, RegToSlot, SlotToReg, SlotToReg, SlotToReg, #25 - FunctionReturn, Transfer, SlotToReg, SlotToReg, Syscall, #30 + SlotToReg, RegToSlot, SlotToReg, SlotToReg, FunctionReturn, #25 + Transfer, SlotToReg, SlotToReg, Transfer, Syscall, #30 NilClass,] #35 - assert_kind_of Parfait::NilClass , get_return + assert_kind_of NilClass , get_return end def test_load_false_const load = main_ticks(1) diff --git a/test/risc/test_interpreter.rb b/test/risc/test_interpreter.rb index bdb425ed..b5474b2a 100644 --- a/test/risc/test_interpreter.rb +++ b/test/risc/test_interpreter.rb @@ -75,7 +75,7 @@ module Risc end def test_tick_26_exit # 26.times { @interpreter.tick ;puts @interpreter.instruction.class} - ticks(26) + ticks(27) assert_equal Syscall , @interpreter.instruction.class assert_equal :exit , @interpreter.instruction.name end