fixed interpreter tests

This commit is contained in:
Torsten Ruger 2015-09-21 00:09:11 +03:00
parent b1cab4f395
commit a5b09ab059
3 changed files with 13 additions and 5 deletions

View File

@ -1,10 +1,13 @@
require_relative "helper"
class AddTest < MiniTest::Test
include AST::Sexp
def setup
Virtual.machine.boot
code =Ast::OperatorExpression.new("+", Ast::IntegerExpression.new(2),Ast::IntegerExpression.new(5))
code = s(:call,
s(:name, :plus),
s(:arguments , s(:int , 5)),
s(:receiver, s(:int, 2)))
Bosl::Compiler.compile( code , Virtual.machine.space.get_main )
Virtual.machine.run_before "Register::CallImplementation"
@interpreter = Interpreter::Interpreter.new

View File

@ -1,10 +1,15 @@
require_relative "helper"
class TestPuts < MiniTest::Test
include AST::Sexp
def setup
Virtual.machine.boot
code = Ast::ExpressionList.new( [Ast::CallSiteExpression.new(:putstring, [] ,Ast::StringExpression.new("Hello again"))])
code = s(:call,
s(:name, :putstring),
s(:arguments),
s(:receiver,
s(:string, "Hello again")))
Bosl::Compiler.compile( code , Virtual.machine.space.get_main )
Virtual.machine.run_before "Register::CallImplementation"
@interpreter = Interpreter::Interpreter.new

View File

@ -6,4 +6,4 @@ require_relative "fragments/test_all"
#require_relative "virtual/test_all"
#require_relative "interpreter/test_all"
require_relative "interpreter/test_all"