removed unused NamedList
args and locals got inlined into message, forgot to delete then ripples out due to type creation small type class api change, more ripples, but also more consistent
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Parfait
|
||||
class TestNamedLists < ParfaitTest
|
||||
|
||||
def test_new
|
||||
list = NamedList.new
|
||||
assert list.get_type
|
||||
end
|
||||
def test_var_names
|
||||
list = NamedList.new
|
||||
assert_equal List , list.get_instance_variables.class
|
||||
end
|
||||
def test_var_names_length
|
||||
list = NamedList.new
|
||||
assert_equal 1 , list.get_instance_variables.get_length
|
||||
end
|
||||
end
|
||||
end
|
@ -32,7 +32,7 @@ module Parfait
|
||||
assert_equal 64 , list.padded_length
|
||||
end
|
||||
def test_type
|
||||
type = Parfait::Type.for_hash Parfait.object_space.get_class_by_name(:Object) , {}
|
||||
type = Parfait::Type.for_hash( {} )
|
||||
type.set_type( type )
|
||||
assert_equal 32 , type.padded_length
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ module Parfait
|
||||
def classes
|
||||
[:BinaryCode,:Block,:CacheEntry,:Callable,:CallableMethod,:Class,
|
||||
:DataObject,:Data4,:Data8,:Data16,:Data32,:Dictionary,:Factory, :Integer,:FalseClass,
|
||||
:List,:Message, :MetaClass, :NamedList,:NilClass,:Object,:ReturnAddress,
|
||||
:List,:Message, :MetaClass,:NilClass,:Object,:ReturnAddress,
|
||||
:Space,:TrueClass,:Type,:VoolMethod,:Word]
|
||||
end
|
||||
|
||||
@ -123,7 +123,7 @@ module Parfait
|
||||
end
|
||||
|
||||
def test_created_class_is_stored
|
||||
@space.create_class( :NewerClass )
|
||||
clazz = @space.create_class( :NewerClass )
|
||||
assert @space.get_class_by_name(:NewerClass)
|
||||
end
|
||||
|
||||
|
@ -37,9 +37,8 @@ module Parfait
|
||||
end
|
||||
|
||||
def test_hash_for_no_ivars
|
||||
list = @space.get_class_by_name(:NamedList )
|
||||
t1 = Parfait::Type.for_hash( list , type: :NewInt)
|
||||
t2 = Parfait::Type.for_hash( list , type: :NewObj)
|
||||
t1 = Parfait::Type.for_hash( {type: :NewInt})
|
||||
t2 = Parfait::Type.for_hash( {type: :NewObj})
|
||||
assert t1.hash != t2.hash , "Hashes should differ"
|
||||
end
|
||||
end
|
||||
|
@ -10,10 +10,10 @@ module Parfait
|
||||
end
|
||||
|
||||
def empty_frame
|
||||
Parfait::Type.for_hash( @try_class , { })
|
||||
Parfait::Type.for_hash( { } , @try_class)
|
||||
end
|
||||
def foo_method( for_class = :Try)
|
||||
args = Parfait::Type.for_hash( @try_class , { bar: :Integer})
|
||||
args = Parfait::Type.for_hash( { bar: :Integer} , @try_class )
|
||||
CallableMethod.new( :foo ,@space.get_type_by_class_name(for_class) , args,empty_frame)
|
||||
end
|
||||
def add_foo_to( clazz = :Try )
|
||||
@ -44,7 +44,7 @@ module Parfait
|
||||
end
|
||||
end
|
||||
def test_create_method
|
||||
args = Parfait::Type.for_hash( @try_class , { bar: :Integer})
|
||||
args = Parfait::Type.for_hash( { bar: :Integer} , @try_class)
|
||||
@try_type.create_method :bar, args , empty_frame
|
||||
assert @try_type.method_names.inspect.include?("bar")
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module Parfait
|
||||
|
||||
def setup
|
||||
super
|
||||
tc = @space.get_class_by_name( :NamedList )
|
||||
tc = @space.get_class_by_name( :Object )
|
||||
@type = tc.instance_type
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user