Introduce singleton types
Just for future, as this gives us a way to know immediately in the type, which represent normal, and which singleton classes Also instantiate singleton class lazily (with singleton type) This makes the type of class single, ie unique, immediately when it is used, ie methods or variables defined. Fixes a design mistake, where all singletonn classes shared the same type, and thus unique methods per class were impossible (Also some misc in commit)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module RubyX
|
||||
class TestIntegerCompile# < MiniTest::Test
|
||||
class TestIntegerCompile < MiniTest::Test
|
||||
include ParfaitHelper
|
||||
def setup
|
||||
@compiler = compiler
|
||||
@ -26,14 +26,17 @@ module RubyX
|
||||
assert_equal :Data8 , vool[3].name
|
||||
end
|
||||
def test_mom
|
||||
mom = @compiler.ruby_to_mom source
|
||||
vool = @compiler.ruby_to_vool source
|
||||
vool.to_parfait
|
||||
#puts vool
|
||||
mom = vool.to_mom(nil)
|
||||
assert_equal Mom::MomCollection , mom.class
|
||||
end
|
||||
def test_risc
|
||||
def est_risc
|
||||
risc = compiler.ruby_to_risc source
|
||||
assert_equal Risc::RiscCollection , risc.class
|
||||
end
|
||||
def test_binary
|
||||
def est_binary
|
||||
risc = compiler.ruby_to_binary source , :interpreter
|
||||
assert_equal Risc::Linker , risc.class
|
||||
end
|
||||
|
@ -48,7 +48,7 @@ module RubyX
|
||||
end
|
||||
end
|
||||
end
|
||||
class TestObjectRtTest #< Minitest::Test
|
||||
class TestObjectRtTest < Minitest::Test
|
||||
self.class.include ParfaitHelper
|
||||
include Risc::Ticker
|
||||
|
||||
|
Reference in New Issue
Block a user