use method missing in resolve method
not just exit try to print name next
This commit is contained in:
@ -14,7 +14,7 @@ module Mom
|
||||
assert_equal Risc::MethodCompiler , @method.to_risc.class
|
||||
end
|
||||
def test_risc_length
|
||||
assert_equal 42 , @method.to_risc.risc_instructions.length
|
||||
assert_equal 21 , @method.to_risc.risc_instructions.length
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -12,13 +12,16 @@ module Mom
|
||||
assert_equal MomCollection , @comp.class
|
||||
end
|
||||
def test_compilers
|
||||
assert_equal 2 , @comp.compilers.length
|
||||
assert_equal 3 , @comp.compilers.length
|
||||
end
|
||||
def test_init_compilers
|
||||
assert_equal Array , @comp.init_compiler.class
|
||||
end
|
||||
def test_init_compiler
|
||||
assert_equal Mom::MethodCompiler , @comp.init_compiler.class
|
||||
assert_equal Mom::MethodCompiler , @comp.init_compiler.first.class
|
||||
end
|
||||
def test_compilers_bare
|
||||
assert_equal 1 , MomCollection.new.compilers.length
|
||||
assert_equal 2 , MomCollection.new.compilers.length
|
||||
end
|
||||
def test_append_class
|
||||
assert_equal MomCollection, (@comp.append @comp).class
|
||||
@ -42,7 +45,7 @@ module Mom
|
||||
end
|
||||
def test_has_risc_compiler
|
||||
assert_equal Risc::MethodCompiler, compiler.class
|
||||
assert_equal 2, @collection.method_compilers.length
|
||||
assert_equal 3, @collection.method_compilers.length
|
||||
end
|
||||
def test_has_risc_instructions
|
||||
assert_equal Risc::Label, compiler.risc_instructions.class
|
||||
|
@ -38,7 +38,7 @@ module Risc
|
||||
ret = main_ticks(49)
|
||||
assert_equal FunctionReturn , ret.class
|
||||
assert_equal :r3 , ret.register.symbol
|
||||
assert_equal 38140 , @interpreter.get_register(ret.register)
|
||||
assert_equal 38236 , @interpreter.get_register(ret.register)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ module Risc
|
||||
end
|
||||
|
||||
def len
|
||||
1476
|
||||
1479
|
||||
end
|
||||
|
||||
def test_collect_all_types
|
||||
@ -70,7 +70,7 @@ module Risc
|
||||
end
|
||||
|
||||
def len
|
||||
2956
|
||||
2959
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -52,14 +52,11 @@ module Risc
|
||||
@interpreter.tick
|
||||
assert_equal 2 , @interpreter.clock
|
||||
end
|
||||
def test_pc1
|
||||
def test_pc
|
||||
@interpreter.tick
|
||||
assert_equal 37704 , @interpreter.pc
|
||||
end
|
||||
def test_pc2
|
||||
assert_equal t = 37800 , @interpreter.pc
|
||||
@interpreter.tick
|
||||
@interpreter.tick
|
||||
assert_equal 37708 , @interpreter.pc
|
||||
assert_equal t + 4 , @interpreter.pc
|
||||
end
|
||||
def test_tick2
|
||||
@interpreter.tick
|
||||
|
@ -24,7 +24,7 @@ module Risc
|
||||
assert_equal 0 , Position.get(@linker.cpu_init).at
|
||||
end
|
||||
def test_cpu_at
|
||||
assert_equal "0x93bc" , Position.get(@linker.cpu_init.first).to_s
|
||||
assert_equal "0x941c" , Position.get(@linker.cpu_init.first).to_s
|
||||
end
|
||||
def test_cpu_label
|
||||
assert_equal Position , Position.get(@linker.cpu_init.first).class
|
||||
|
@ -16,7 +16,7 @@ module Risc
|
||||
assert_equal 1 , mains.length
|
||||
end
|
||||
def test_assembler_num
|
||||
assert_equal 2 , @linker.assemblers.length
|
||||
assert_equal 3 , @linker.assemblers.length
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -28,7 +28,7 @@ GET
|
||||
assert_equal Mom::MethodMissing , compiler.mom_instructions.next.class
|
||||
end
|
||||
def test_risc
|
||||
assert_equal 42 , compiler.to_risc.risc_instructions.length
|
||||
assert_equal 21 , compiler.to_risc.risc_instructions.length
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -23,7 +23,7 @@ module RubyX
|
||||
end
|
||||
def test_asm_len
|
||||
linker = @collection.translate(:interpreter)
|
||||
assert_equal 2 , linker.assemblers.length
|
||||
assert_equal 3 , linker.assemblers.length
|
||||
end
|
||||
end
|
||||
class TestRubyXCompilerParfait < MiniTest::Test
|
||||
|
@ -36,7 +36,7 @@ module RubyX
|
||||
assert_equal 2 , compiler.vool.length
|
||||
linker = compiler.to_binary(:interpreter)
|
||||
assert_equal Risc::Linker , linker.class
|
||||
assert_equal 3 , linker.assemblers.length
|
||||
assert_equal 4 , linker.assemblers.length
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user