2019-08-14 10:11:26 +02:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
module Risc
|
|
|
|
class TestClassCallSimple < MiniTest::Test
|
|
|
|
include Statements
|
|
|
|
|
|
|
|
def setup
|
|
|
|
@class_input = "def self.simple_return; return 1 ; end;"
|
2019-09-13 13:07:12 +02:00
|
|
|
@input = "return Space.simple_return"
|
2019-08-14 10:11:26 +02:00
|
|
|
@expect = [LoadConstant, RegToSlot, Branch]
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_send_instructions
|
|
|
|
assert_nil msg = check_nil(:simple_return) , msg
|
|
|
|
end
|
|
|
|
def test_load_simple
|
|
|
|
produced = produce_target(:simple_return).next(1)
|
|
|
|
assert_load( produced , Parfait::Integer)
|
|
|
|
assert_equal 1 , produced.constant.value
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|