Torsten Rüger
66728f09f4
after some serious recursive thinking it now actually makes sense. The key was to change the actual type of the class that the meta_class manages For objects it's (still) ok just to change the instance_type, but since the class object exists and has type, when adding instance variables, that actual type has to change
34 lines
584 B
Ruby
34 lines
584 B
Ruby
require_relative "../helper"
|
|
|
|
module Risc
|
|
class InterpreterSetters < MiniTest::Test
|
|
include Ticker
|
|
|
|
def setup
|
|
@preload = "Integer.div4"
|
|
@string_input = <<MAIN
|
|
class Space
|
|
def self.set(num)
|
|
@inst = num
|
|
end
|
|
def self.get
|
|
return @inst
|
|
end
|
|
def main(arg)
|
|
Space.set(5)
|
|
return Space.get
|
|
end
|
|
end
|
|
MAIN
|
|
super
|
|
end
|
|
|
|
def test_chain
|
|
#show_main_ticks # get output of what is
|
|
run_input @string_input
|
|
assert_equal 5 , get_return
|
|
end
|
|
|
|
end
|
|
end
|