From e80d028f7bb082f0990fbd6ed5f47f388ae67f0b Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Fri, 30 Dec 2016 20:48:14 +0200 Subject: [PATCH] test to check that types are types which led to dictionary bug --- test/register/test_all.rb | 1 + test/register/test_machine.rb | 18 ++++++++++++++++++ test/typed/expressions/test_basic.rb | 1 + 3 files changed, 20 insertions(+) create mode 100644 test/register/test_machine.rb diff --git a/test/register/test_all.rb b/test/register/test_all.rb index 685c1620..b6f4d1f9 100644 --- a/test/register/test_all.rb +++ b/test/register/test_all.rb @@ -2,5 +2,6 @@ require_relative "interpreter/test_all" require_relative "test_compat" require_relative "test_instructions" +require_relative "test_machine" require_relative "test_padding" require_relative "test_positioning" diff --git a/test/register/test_machine.rb b/test/register/test_machine.rb new file mode 100644 index 00000000..9210e5d1 --- /dev/null +++ b/test/register/test_machine.rb @@ -0,0 +1,18 @@ +require_relative "../helper" + +module Register + class TestMachine < MiniTest::Test + + def setup + @machine = Register.machine.boot + end + + def test_collect_all_types + @machine.collect_space + @machine.objects.each do |id, objekt| + next unless objekt.is_a?( Parfait::Type ) + assert Parfait.object_space.get_type_for( objekt.hash ) , objekt.hash + end + end + end +end diff --git a/test/typed/expressions/test_basic.rb b/test/typed/expressions/test_basic.rb index 1b645476..72c6b3fc 100644 --- a/test/typed/expressions/test_basic.rb +++ b/test/typed/expressions/test_basic.rb @@ -6,6 +6,7 @@ class TestBasic < MiniTest::Test include AST::Sexp def setup + Register.machine.boot @output = Register::RegisterValue end