From f6886114166ac30803f7c37b912496af4e57b2f3 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 10 Dec 2016 16:28:42 +0200 Subject: [PATCH] fix variable expression tests --- test/typed/expressions/test_all.rb | 3 ++- test/typed/expressions/test_vars.rb | 34 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test/typed/expressions/test_vars.rb diff --git a/test/typed/expressions/test_all.rb b/test/typed/expressions/test_all.rb index 47e61631..5f9e5bbf 100644 --- a/test/typed/expressions/test_all.rb +++ b/test/typed/expressions/test_all.rb @@ -1,4 +1,5 @@ require_relative "test_basic" +require_relative "test_call" require_relative "test_field_access" require_relative "test_ops" -require_relative "test_call" +require_relative "test_vars" diff --git a/test/typed/expressions/test_vars.rb b/test/typed/expressions/test_vars.rb new file mode 100644 index 00000000..1e61cbd2 --- /dev/null +++ b/test/typed/expressions/test_vars.rb @@ -0,0 +1,34 @@ +require_relative "helper" + +module Register + class TestFields < MiniTest::Test + include ExpressionHelper + include AST::Sexp + + def setup + Register.machine.boot + end + + def test_local + Register.machine.space.get_main.ensure_local(:bar , :Integer) + @input = s(:name, :bar) + @output = Register::RegisterValue + check + end + + def test_space + @root = :name + @input = s(:name, :space) + @output = Register::RegisterValue + check + end + + def test_args + Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar) + @input = s(:name, :bar) + @output = Register::RegisterValue + check + end + + end +end