rubyx/test/mom/instruction/helper.rb

37 lines
710 B
Ruby
Raw Normal View History

2018-05-15 18:29:27 +02:00
require_relative '../helper'
module Mom
class InstructionMock < Instruction
2019-08-10 20:59:31 +02:00
def initialize
super("mocking")
end
2018-05-15 18:29:27 +02:00
end
class MomInstructionTest < MiniTest::Test
include Output
def setup
Parfait.boot!(Parfait.default_test_options)
@instruction = instruction
@compiler = Risc::MethodCompiler.new(FakeCallable.new , Label.new("source","start"))
@instruction.to_risc(@compiler)
@risc = @compiler.risc_instructions
end
def risc(at)
return @risc if at == 0
@risc.next( at )
end
def all
ret = []
@risc.each {|i| ret << i}
ret
end
def all_str
class_list(all.collect{|i|i.class})
end
end
2018-05-15 18:29:27 +02:00
end