From d82cedf4c095ceaf33c4bd02b460cd9e64abc40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20R=C3=BCger?= Date: Mon, 9 Sep 2019 20:29:18 +0300 Subject: [PATCH] Quite small amount of parfait tests needed changing after that But something is amiss anyway, especially dynamic jumps --- lib/parfait/object.rb | 8 -------- test/parfait/test_attributes.rb | 4 ++-- test/parfait/test_list.rb | 3 ++- test/parfait/test_space.rb | 4 ++-- test/parfait/type/test_hash.rb | 2 +- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/parfait/object.rb b/lib/parfait/object.rb index b4e14f60..02721ef0 100644 --- a/lib/parfait/object.rb +++ b/lib/parfait/object.rb @@ -94,13 +94,5 @@ module Parfait get_instance_variables.to_a.collect{ |n| n.to_s.to_sym } end - # name comes in as a ruby var name - def instance_variable_ged( name ) - #TODO the [] shoud be a range, but currenly that is not processed in RubyCompiler - var = get_instance_variable name.to_s[1 , name.to_s.length - 1].to_sym - #puts "getting #{name} #{var}" - var - end - end end diff --git a/test/parfait/test_attributes.rb b/test/parfait/test_attributes.rb index 031e9f46..721e50a3 100644 --- a/test/parfait/test_attributes.rb +++ b/test/parfait/test_attributes.rb @@ -19,7 +19,7 @@ module Parfait assert_nil @mess.method end def test_message_next_set - @mess.next_message = :next_message + @mess._set_next_message :next_message assert_equal :next_message , @mess.next_message end def test_message_type_set @@ -27,7 +27,7 @@ module Parfait assert_equal @type , @mess.get_type end def test_attribute_index - @mess.next_message = :message + @mess._set_next_message :message assert_equal Parfait::Type , @mess.get_type.class end diff --git a/test/parfait/test_list.rb b/test/parfait/test_list.rb index 0ce24803..d8d68597 100644 --- a/test/parfait/test_list.rb +++ b/test/parfait/test_list.rb @@ -68,7 +68,8 @@ module Parfait end def test_one_set1 assert_equal 2 , @list.set(0,2) - assert_equal 1 , @list.get_internal_word(1) +# assert_equal 1 , @list.get_internal_word(1) + assert_equal 1 , @list.get_length assert_equal 2 , @list.get_internal_word(List.type_length) end def test_set1_len diff --git a/test/parfait/test_space.rb b/test/parfait/test_space.rb index dfee5f43..a0ddcdf7 100644 --- a/test/parfait/test_space.rb +++ b/test/parfait/test_space.rb @@ -46,7 +46,7 @@ module Parfait assert_equal classes.length , @space.classes.length , @space.classes.keys.inspect end def test_types - assert @space.instance_variable_ged("@types").is_a? Parfait::Dictionary + assert @space.types.is_a? Parfait::Dictionary end def test_types_attr assert @space.types.is_a? Parfait::Dictionary @@ -57,7 +57,7 @@ module Parfait end end def test_types_hashes - types = @space.instance_variable_ged("@types") + types = @space.types types.each do |has , type| assert has.is_a?(::Integer) , has.inspect end diff --git a/test/parfait/type/test_hash.rb b/test/parfait/type/test_hash.rb index 9ed6886d..4b9ab24e 100644 --- a/test/parfait/type/test_hash.rb +++ b/test/parfait/type/test_hash.rb @@ -5,7 +5,7 @@ module Parfait def setup super - @types = @space.instance_variable_ged("@types") + @types = @space.types @first = @types.values.first end