small test setup fixes

This commit is contained in:
Torsten Ruger 2016-12-10 18:48:41 +02:00
parent 6d4347c7ba
commit a3e8d19bb7
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -4,4 +4,6 @@ require_relative "type/test_all"
require_relative "expressions/test_all"
require_relative "statements/test_all"
require_relative "test_to_code"