rubyx/test/risc/instructions/test_load_constant.rb
Torsten 53eb28fff4 load constant to create register names with class
Just the id_ did give no clue to the contents, just took care of the uniqueness.
Better for debugging
2020-03-22 14:31:43 +02:00

29 lines
625 B
Ruby

require_relative "../helper"
module Risc
class TestLoadConstant < MiniTest::Test
def setup
Parfait.boot!({})
end
def risc(i)
const = SlotMachine::StringConstant.new("hi")
Risc.load_constant("source" , const)
end
def test_const
assert_load 1 , SlotMachine::StringConstant , "id_string_"
end
end
class TestLoadConstant1 < MiniTest::Test
def setup
Parfait.boot!({})
end
def risc(i)
const = Parfait.new_word("hi")
Risc.load_constant("source" , const)
end
def test_parf
assert_load 1 , Parfait::Word , "id_word_"
end
end
end