diff --git a/test/typed/statements/helper.rb b/test/typed/statements/helper.rb index e59eec97..913d0189 100644 --- a/test/typed/statements/helper.rb +++ b/test/typed/statements/helper.rb @@ -4,21 +4,19 @@ require_relative '../helper' module Statements include AST::Sexp + def setup + Register.machine.boot # force boot to reset main + end + def check assert @expect , "No output given" - Register.machine.boot # force boot to reset main compiler = Typed::Compiler.new Register.machine.space.get_main produced = compiler.process( Typed.ast_to_code( @input) ) - assert_nil produced.first , "Statements should result in nil" produced = Register.machine.space.get_main.instructions compare_instructions produced , @expect produced end - def as_main(statements) - s(:statements, s(:class, :Space, s(:derives, nil), statements )) - end - def compare_instructions instruction , expect index = 0 start = instruction diff --git a/test/typed/test_all.rb b/test/typed/test_all.rb index f443e6fe..b405a29a 100644 --- a/test/typed/test_all.rb +++ b/test/typed/test_all.rb @@ -4,4 +4,6 @@ require_relative "type/test_all" require_relative "expressions/test_all" +require_relative "statements/test_all" + require_relative "test_to_code"