Now booting all original methods

Just need to refactor now
This commit is contained in:
2019-08-12 11:31:47 +03:00
parent 91ddae2251
commit 2326081161
4 changed files with 59 additions and 18 deletions

View File

@ -53,7 +53,7 @@ module Risc
assert_equal Risc::MethodCompiler , @method.to_risc.class
end
def test_risc_length
assert_equal 27 , @method.to_risc.risc_instructions.length
assert_equal 28 , @method.to_risc.risc_instructions.length
end
end
class TestIntComp2 < BootTest
@ -74,5 +74,32 @@ module Risc
assert_equal 27 , @method.to_risc.risc_instructions.length
end
end
class TestIntOperators < BootTest
def setup
super
end
def each_method &block
Risc.operators.each do |name|
method = get_compiler(name)
block.yield(method)
end
end
def test_has_get_internal
each_method do |method|
assert_equal Mom::MethodCompiler , method.class
assert_equal 5 , method.mom_instructions.length
end
end
def test_compile
each_method do |method|
assert_equal Risc::MethodCompiler , method.to_risc.class
end
end
def test_risc_length
each_method do |method|
assert_equal 49 , method.to_risc.risc_instructions.length
end
end
end
end
end

View File

@ -14,7 +14,7 @@ module Risc
assert_equal Array, @functions.class
end
def test_boot_function_length
assert_equal 15, @functions.length
assert_equal 22, @functions.length
end
def test_boot_function_first
assert_equal Mom::MethodCompiler, @functions.first.class