rename meta to singleton class
seems more appropriate, as it is the class for a single object Also seems to be called that on the net (don't remember where the meta came from, but it's gone)
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Parfait
|
||||
class TestMetaClass < ParfaitTest
|
||||
class TestSingletonClass < ParfaitTest
|
||||
|
||||
def setup
|
||||
super
|
||||
@try = @space.create_class( :Try , :Object).meta_class
|
||||
@try = @space.create_class( :Try , :Object).singleton_class
|
||||
end
|
||||
|
||||
def test_type_forclass
|
||||
@ -17,7 +17,7 @@ module Parfait
|
||||
end
|
||||
def test_new_superclass
|
||||
assert_equal "Class(Try)" , @try.clazz.inspect
|
||||
assert_equal "MetaClass(Try)" , @try.inspect
|
||||
assert_equal "SingletonClass(Try)" , @try.inspect
|
||||
end
|
||||
def test_new_methods
|
||||
assert_equal @try.method_names.class, @try.instance_methods.class
|
@ -6,7 +6,7 @@ module Parfait
|
||||
def classes
|
||||
[:Behaviour ,:BinaryCode,:Block,:CacheEntry,:Callable,:CallableMethod,:Class,
|
||||
:DataObject,:Data4,:Data8,:Data16,:Data32,:Dictionary,:Factory, :Integer,:FalseClass,
|
||||
:List,:Message, :MetaClass,:NilClass,:Object,:ReturnAddress,
|
||||
:List,:Message, :SingletonClass,:NilClass,:Object,:ReturnAddress,
|
||||
:Space,:TrueClass,:Type,:VoolMethod,:Word]
|
||||
end
|
||||
|
||||
@ -27,8 +27,8 @@ module Parfait
|
||||
def test_get_class_by_name
|
||||
assert_equal Parfait::Class , space_class.class
|
||||
end
|
||||
def test_get_meta_class
|
||||
assert_equal Parfait::MetaClass , space_class.meta_class.class
|
||||
def test_get_singleton_class
|
||||
assert_equal Parfait::SingletonClass , space_class.singleton_class.class
|
||||
end
|
||||
def test_get_type_by_class_name
|
||||
assert_equal Parfait::Type , Parfait.object_space.get_type_by_class_name(:Space).class
|
||||
@ -72,9 +72,9 @@ module Parfait
|
||||
end
|
||||
end
|
||||
end
|
||||
def test_all_meta
|
||||
def test_all_singletons
|
||||
@space.classes.each do |name , clazz|
|
||||
assert clazz.meta_class , clazz.name
|
||||
assert clazz.singleton_class , clazz.name
|
||||
end
|
||||
end
|
||||
def test_has_factory
|
||||
|
@ -19,7 +19,7 @@ module Risc
|
||||
MAIN
|
||||
super
|
||||
end
|
||||
#Space type is wrong, shold be same as meta_class.instance_type
|
||||
#Space type is wrong, shold be same as singleton_class.instance_type
|
||||
def test_chain
|
||||
#show_main_ticks # get output of what is
|
||||
run_input @string_input
|
||||
|
@ -27,7 +27,7 @@ module Vool
|
||||
def test_class_inst
|
||||
space_class = Parfait.object_space.get_class
|
||||
assert_equal :Space , space_class.name
|
||||
names = space_class.meta_class.instance_type.names
|
||||
names = space_class.singleton_class.instance_type.names
|
||||
assert names.index_of(:inst) , names
|
||||
end
|
||||
def test_compiler
|
||||
|
Reference in New Issue
Block a user