More tests and compiling parfait object
This commit is contained in:
parent
fd46826b9c
commit
1e2c4d6678
30
test/risc/interpreter/class/test_class_inst.rb
Normal file
30
test/risc/interpreter/class/test_class_inst.rb
Normal file
@ -0,0 +1,30 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module Risc
|
||||
class InterpreterSetters < MiniTest::Test
|
||||
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
|
||||
|
||||
def test_chain
|
||||
#show_main_ticks # get output of what is
|
||||
run_input @string_input
|
||||
assert_equal 5 , get_return
|
||||
end
|
||||
|
||||
end
|
||||
end
|
33
test/risc/interpreter/class/test_class_inst_set.rb
Normal file
33
test/risc/interpreter/class/test_class_inst_set.rb
Normal file
@ -0,0 +1,33 @@
|
||||
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
|
29
test/risc/interpreter/class/test_class_send.rb
Normal file
29
test/risc/interpreter/class/test_class_send.rb
Normal file
@ -0,0 +1,29 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module Risc
|
||||
class InterpreterClassSend < MiniTest::Test
|
||||
include Ticker
|
||||
|
||||
def setup
|
||||
@preload = "Integer.div4"
|
||||
@string_input = <<MAIN
|
||||
class Space
|
||||
def self.get
|
||||
return 5
|
||||
end
|
||||
def main(arg)
|
||||
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
|
@ -2,7 +2,7 @@ require_relative "../helper"
|
||||
|
||||
module RubyX
|
||||
|
||||
class TestObjectCompile #< MiniTest::Test
|
||||
class TestObjectCompile < MiniTest::Test
|
||||
include ParfaitHelper
|
||||
include Preloader
|
||||
|
||||
|
@ -26,7 +26,7 @@ module RubyX
|
||||
assert_equal 3 , linker.assemblers.length
|
||||
end
|
||||
end
|
||||
class TestRubyXCompilerParfait #< MiniTest::Test
|
||||
class TestRubyXCompilerParfait < MiniTest::Test
|
||||
include ScopeHelper
|
||||
include RubyXHelper
|
||||
|
||||
@ -38,7 +38,6 @@ module RubyX
|
||||
|
||||
def test_load
|
||||
object = Parfait.object_space.get_class_by_name(:Object)
|
||||
#object.methods.each_method {|m| puts m.name}
|
||||
assert_equal Parfait::VoolMethod , object.get_method(:set_type).class
|
||||
assert_equal Parfait::CallableMethod , object.instance_type.get_method(:set_type).class
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user