the superclass of a singleton class is the singleton class of the superclass

And i have tests to prove it!
That just rolls of the tongue, it had to be the commit message
This commit is contained in:
2019-10-01 20:55:05 +03:00
parent 2dcb2a9a72
commit 48e18ac9cd
5 changed files with 19 additions and 9 deletions

View File

@ -55,5 +55,11 @@ module Parfait
def test_type_is_single
assert_equal true , @try.instance_type.is_single?
end
def test_super_class
assert_equal SingletonClass , @try.super_class.class
end
def test_super_class_name
assert_equal :"Object.Single" , @try.super_class_name
end
end
end

View File

@ -7,12 +7,12 @@ module Vool
def class_main
<<-eos
class Space
class Object
def self.one_plus()
return 1 + 1
return 1
end
end
class Space
class Space < Object
def main(arg)
return Space.one_plus
end
@ -21,8 +21,7 @@ module Vool
end
def setup
source = "class Integer < Data4;def +(other);X.int_operator(:+);end;end;" + class_main
ret = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(source)
ret = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(class_main)
@ins = ret.compilers.find_compiler_name(:main).mom_instructions.next
end
def test_array