fixed interpreter tests
This commit is contained in:
parent
b1cab4f395
commit
a5b09ab059
@ -1,10 +1,13 @@
|
|||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
|
|
||||||
class AddTest < MiniTest::Test
|
class AddTest < MiniTest::Test
|
||||||
|
include AST::Sexp
|
||||||
def setup
|
def setup
|
||||||
Virtual.machine.boot
|
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 )
|
Bosl::Compiler.compile( code , Virtual.machine.space.get_main )
|
||||||
Virtual.machine.run_before "Register::CallImplementation"
|
Virtual.machine.run_before "Register::CallImplementation"
|
||||||
@interpreter = Interpreter::Interpreter.new
|
@interpreter = Interpreter::Interpreter.new
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
|
|
||||||
class TestPuts < MiniTest::Test
|
class TestPuts < MiniTest::Test
|
||||||
|
include AST::Sexp
|
||||||
def setup
|
def setup
|
||||||
Virtual.machine.boot
|
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 )
|
Bosl::Compiler.compile( code , Virtual.machine.space.get_main )
|
||||||
Virtual.machine.run_before "Register::CallImplementation"
|
Virtual.machine.run_before "Register::CallImplementation"
|
||||||
@interpreter = Interpreter::Interpreter.new
|
@interpreter = Interpreter::Interpreter.new
|
||||||
|
@ -6,4 +6,4 @@ require_relative "fragments/test_all"
|
|||||||
|
|
||||||
#require_relative "virtual/test_all"
|
#require_relative "virtual/test_all"
|
||||||
|
|
||||||
#require_relative "interpreter/test_all"
|
require_relative "interpreter/test_all"
|
||||||
|
Loading…
Reference in New Issue
Block a user