Torsten Rüger
9a2716280c
Since they were embedded at first (easier copy/paste) they now got own files, like their brethren also mini tests for each instruction , nice start
28 lines
605 B
Ruby
28 lines
605 B
Ruby
require_relative "helper"
|
|
|
|
module Mom
|
|
module Builtin
|
|
class TestIntOperatorsRisc < 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_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
|