start to split tests according to feature
This commit is contained in:
29
test/parser/helper.rb
Normal file
29
test/parser/helper.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module ParserTest
|
||||
|
||||
def setup
|
||||
@parser = Parser::Composed.new
|
||||
@transform = Parser::Transform.new
|
||||
end
|
||||
|
||||
def check_parse
|
||||
is = @parser.parse(@input)
|
||||
#puts is.inspect
|
||||
assert_equal @expected , is
|
||||
end
|
||||
|
||||
def check_transform
|
||||
is = @transform.apply @input
|
||||
#puts is.transform
|
||||
assert_equal @expected , is
|
||||
end
|
||||
|
||||
def check_ast
|
||||
syntax = @parser.parse(@input)
|
||||
tree = @transform.apply(syntax)
|
||||
# puts tree.inspect
|
||||
assert_equal @expected , tree
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user