keyword expressions

and smaller new harness
This commit is contained in:
Torsten Ruger
2015-08-29 11:45:16 +03:00
parent d5a0736f48
commit fa27ebebdf
2 changed files with 32 additions and 9 deletions

View File

@ -1,23 +1,35 @@
require_relative "../parser_helper"
require_relative "../setup"
class TestBasic < MiniTest::Test
# include the magic (setup and parse -> test method translation), see there
include ParserHelper
#include ParserHelper
def setup
@parser = Keywords
end
def check
parse = @parser.parse(@input)
assert_equal @input , parse
assert_equal @output , parse.value
end
def test_true
@input = 'true '
@output = Ast::TrueExpression.new()
@root = :keyword_true
check
end
def ttest_false
def test_false
@input = 'false '
@output = Ast::FalseExpression.new()
@root = :basic_type
check
end
def ttest_nil
def test_nil
@input = 'nil '
@output = Ast::NilExpression.new()
@root = :basic_type
check
end
def ttest_number