fixed asserts
This commit is contained in:
parent
5423bc8f7e
commit
96a9cd3270
@ -19,19 +19,19 @@ class TestNodes < MiniTest::Test
|
||||
|
||||
def test_number
|
||||
tree = parse "42"
|
||||
assert tree.is_a? Vm::NumberExpression
|
||||
assert_kind_of Vm::NumberExpression , tree
|
||||
assert_equal 42 , tree.value
|
||||
end
|
||||
def test_args
|
||||
tree = parse "( 42 )"
|
||||
assert tree.is_a? Hash
|
||||
assert tree[:args].is_a? Vm::NumberExpression
|
||||
assert_kind_of Hash , tree
|
||||
assert_kind_of Vm::NumberExpression , tree[:args]
|
||||
assert_equal 42 , tree[:args].value
|
||||
end
|
||||
def test_arg_list
|
||||
@parser = @parser.args
|
||||
tree = parse "(42, foo)"
|
||||
assert_equal Array , tree.class
|
||||
assert_instance_of Array , tree
|
||||
assert_equal 42 , tree.first.value
|
||||
assert_equal "foo" , tree.last.name
|
||||
end
|
||||
|
@ -1,5 +1,4 @@
|
||||
require_relative 'helper'
|
||||
require 'minitest/spec'
|
||||
|
||||
class ParserTest < MiniTest::Test
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user