getter by position

extract and expand position testing
never return labels (that have the same position as their target)
This commit is contained in:
Torsten Ruger
2018-05-17 20:13:33 +03:00
parent 37d62d298e
commit 8966a50a8a
6 changed files with 78 additions and 15 deletions

View File

@ -1,4 +1,4 @@
require_relative "../helper"
require_relative "helper"
module Risc
class TestMachineObjects < MiniTest::Test
@ -18,18 +18,6 @@ module Risc
assert @machine.add_constant( Parfait::Integer.new(5) )
end
end
class TestMachinePositions < MiniTest::Test
def setup
@machine = Risc.machine.boot
@machine.translate(:arm)
@machine.position_all
end
def test_has_positions
@machine.objects.each do |id,obj|
assert Position.get(obj)
end
end
end
class TestMachineInit < MiniTest::Test
def setup
@machine = Risc.machine.boot