small shuffle of test helpers, also guard helpers

This commit is contained in:
Torsten Ruger
2016-12-17 00:15:27 +02:00
parent f8cefcde3c
commit ece017fa86
4 changed files with 17 additions and 6 deletions

View File

@ -3,19 +3,16 @@ require_relative '../helper'
module Statements
include AST::Sexp
include Compiling
def setup
Register.machine.boot # force boot to reset main
end
def clean_compile(clazz_name , method_name , args , statements)
compiler = Typed::Compiler.new.create_method(clazz_name,method_name,args ).init_method
compiler.process( Typed.ast_to_code( statements ) )
end
def check
assert @expect , "No output given"
compiler = Typed::Compiler.new Register.machine.space.get_main
compiler = Typed::Compiler.new
produced = compiler.process( Typed.ast_to_code( @input) )
produced = Register.machine.space.get_main.instructions
compare_instructions produced , @expect