misc to_s and small fixes
This commit is contained in:
@ -54,7 +54,7 @@ module Risc
|
||||
end
|
||||
def test_pc1
|
||||
@interpreter.tick
|
||||
assert_equal 21304 , @interpreter.pc
|
||||
assert_equal 21432 , @interpreter.pc
|
||||
end
|
||||
def test_tick2
|
||||
@interpreter.tick
|
||||
@ -68,7 +68,7 @@ module Risc
|
||||
def test_pc2
|
||||
@interpreter.tick
|
||||
@interpreter.tick
|
||||
assert_equal 21308 , @interpreter.pc
|
||||
assert_equal 21436 , @interpreter.pc
|
||||
end
|
||||
def test_tick_14_jump
|
||||
14.times {@interpreter.tick}
|
||||
|
@ -1,7 +1,7 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Risc
|
||||
class TestMachineObjects < MiniTest::Test
|
||||
class TestLinkerObjects < MiniTest::Test
|
||||
|
||||
def setup
|
||||
Parfait.boot!
|
||||
@ -17,7 +17,7 @@ module Risc
|
||||
assert_raises {@machine.add_constant( 1 )}
|
||||
end
|
||||
end
|
||||
class TestMachineInit < MiniTest::Test
|
||||
class TestLinkerInit < MiniTest::Test
|
||||
def setup
|
||||
Parfait.boot!
|
||||
Risc.boot!
|
||||
|
@ -13,5 +13,12 @@ module Risc
|
||||
assert Position.get(obj).valid? , "#{Position.get(obj)} , #{obj.object_id.to_s(16)}"
|
||||
end
|
||||
end
|
||||
def test_one_main
|
||||
mains = @linker.assemblers.find_all{|asm| asm.method.name == :main }
|
||||
assert_equal 1 , mains.length
|
||||
end
|
||||
def test_assembler_num
|
||||
assert_equal 23 , @linker.assemblers.length
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user