rubyx/test/risc/test_machine.rb

37 lines
786 B
Ruby
Raw Normal View History

require_relative "../helper"
module Risc
2018-03-28 10:37:17 +02:00
class TestMachineObjects < MiniTest::Test
def setup
@machine = Risc.machine.boot
end
def test_objects
objects = @machine.objects
assert_equal Hash , objects.class
assert 350 < objects.length
end
def test_constant_fail
assert_raises {@machine.add_constant( 1 )}
end
def test_constant
assert @machine.add_constant( Parfait::Integer.new(5) )
end
2018-03-28 10:37:17 +02:00
end
class TestMachinePositions < MiniTest::Test
def setup
@machine = Risc.machine.boot
@machine.position_all
end
def test_has_positions
@machine.objects.each do |id,obj|
assert Positioned.position(obj)
end
end
def test_binary
2018-03-28 12:04:25 +02:00
@machine.create_binary
end
end
end