2019-09-19 16:41:26 +02:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
module Risc
|
2019-09-23 19:42:46 +02:00
|
|
|
class InterpreterGetters < MiniTest::Test
|
2019-09-19 16:41:26 +02:00
|
|
|
include Ticker
|
|
|
|
|
|
|
|
def setup
|
|
|
|
@preload = "Integer.div4"
|
|
|
|
@string_input = <<MAIN
|
|
|
|
class Space
|
|
|
|
def self.get
|
|
|
|
@inst = 5
|
|
|
|
return @inst
|
|
|
|
end
|
|
|
|
def main(arg)
|
|
|
|
return Space.get
|
|
|
|
end
|
|
|
|
end
|
|
|
|
MAIN
|
|
|
|
super
|
|
|
|
end
|
2019-09-23 19:57:33 +02:00
|
|
|
#Space type is wrong, shold be same as singleton_class.instance_type
|
2019-09-19 16:41:26 +02:00
|
|
|
def test_chain
|
|
|
|
#show_main_ticks # get output of what is
|
|
|
|
run_input @string_input
|
|
|
|
assert_equal 5 , get_return
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|