From fe195df10e492e380509f1a6f45855e2b684cd8e Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Tue, 6 Dec 2016 17:03:15 +0200 Subject: [PATCH] split existing type tests --- test/typed/type/test_all.rb | 3 ++- .../type/{test_type.rb => test_basic.rb} | 20 +------------- test/typed/type/test_message.rb | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+), 20 deletions(-) rename test/typed/type/{test_type.rb => test_basic.rb} (83%) create mode 100644 test/typed/type/test_message.rb diff --git a/test/typed/type/test_all.rb b/test/typed/type/test_all.rb index 32bbd260..c3f9d16e 100644 --- a/test/typed/type/test_all.rb +++ b/test/typed/type/test_all.rb @@ -1 +1,2 @@ -require_relative "test_type" +require_relative "test_basic" +require_relative "test_message" diff --git a/test/typed/type/test_type.rb b/test/typed/type/test_basic.rb similarity index 83% rename from test/typed/type/test_type.rb rename to test/typed/type/test_basic.rb index 3b286343..3b49d14b 100644 --- a/test/typed/type/test_type.rb +++ b/test/typed/type/test_basic.rb @@ -1,25 +1,11 @@ require_relative "../helper" -class TestType < MiniTest::Test +class BasicType < MiniTest::Test def setup @mess = Register.machine.boot.space.first_message end - def test_message_type - type = @mess.get_type - assert type - assert @mess.instance_variable_defined :next_message - assert_equal @mess.next_message , @mess.get_instance_variable(:next_message) - end - - def test_message_by_index - assert_equal @mess.next_message , @mess.get_instance_variable(:next_message) - index = @mess.get_type.variable_index :next_message - assert_equal 2 , index - assert_equal @mess.next_message , @mess.get_internal_word(index) - end - def test_type_index assert_equal @mess.get_type , @mess.get_internal_word(Parfait::TYPE_INDEX) , "mess" end @@ -49,10 +35,6 @@ class TestType < MiniTest::Test assert_equal 8 , @mess.get_type.get_type.get_internal_word(4) end - def test_type_methods - assert_equal 3 , @mess.get_type.get_type.variable_index(:instance_methods) - end - def test_no_index_below_1 type = @mess.get_type names = type.instance_names diff --git a/test/typed/type/test_message.rb b/test/typed/type/test_message.rb new file mode 100644 index 00000000..5e91cc4f --- /dev/null +++ b/test/typed/type/test_message.rb @@ -0,0 +1,27 @@ +require_relative "../helper" + +class TypeMessages < MiniTest::Test + + def setup + @mess = Register.machine.boot.space.first_message + end + + def test_message_type + type = @mess.get_type + assert type + assert @mess.instance_variable_defined :next_message + assert_equal @mess.next_message , @mess.get_instance_variable(:next_message) + end + + def test_message_by_index + assert_equal @mess.next_message , @mess.get_instance_variable(:next_message) + index = @mess.get_type.variable_index :next_message + assert_equal 2 , index + assert_equal @mess.next_message , @mess.get_internal_word(index) + end + + def test_type_methods + assert_equal 3 , @mess.get_type.get_type.variable_index(:instance_methods) + end + +end