2016-12-30 19:48:14 +01:00
|
|
|
require_relative "../helper"
|
|
|
|
|
2017-01-19 08:02:29 +01:00
|
|
|
module Risc
|
2018-03-28 10:37:17 +02:00
|
|
|
class TestMachineObjects < MiniTest::Test
|
2016-12-30 19:48:14 +01:00
|
|
|
|
|
|
|
def setup
|
2017-01-19 08:02:29 +01:00
|
|
|
@machine = Risc.machine.boot
|
2016-12-30 19:48:14 +01:00
|
|
|
end
|
2018-03-27 17:47:39 +02:00
|
|
|
def test_objects
|
|
|
|
objects = @machine.objects
|
|
|
|
assert_equal Hash , objects.class
|
2018-03-27 18:06:16 +02:00
|
|
|
assert 350 < objects.length
|
2018-03-27 17:47:39 +02:00
|
|
|
end
|
2018-03-28 10:37:17 +02:00
|
|
|
end
|
|
|
|
class TestMachinePositions < MiniTest::Test
|
|
|
|
def setup
|
|
|
|
@machine = Risc.machine.boot
|
2018-03-27 17:47:39 +02:00
|
|
|
@machine.position_all
|
2018-03-27 18:06:16 +02:00
|
|
|
end
|
|
|
|
def test_has_positions
|
|
|
|
@machine.objects.each do |id,obj|
|
|
|
|
assert Positioned.position(obj)
|
|
|
|
end
|
2016-12-30 19:48:14 +01:00
|
|
|
end
|
2018-03-28 11:50:07 +02:00
|
|
|
|
2018-03-27 19:47:41 +02:00
|
|
|
def test_binary
|
2018-03-28 12:04:25 +02:00
|
|
|
@machine.create_binary
|
2018-03-27 19:47:41 +02:00
|
|
|
end
|
2016-12-30 19:48:14 +01:00
|
|
|
end
|
|
|
|
end
|