testing escaped input is awkward

This commit is contained in:
Torsten Ruger 2014-05-08 19:29:35 +03:00
parent 9c2dfe79da
commit 500bc36a29

View File

@ -32,6 +32,18 @@ class TestBasic < MiniTest::Test
@parser = @parser.string @parser = @parser.string
end end
def test_string_escapes
out = "hello nyou"
out[6] = '\\'
@string_input = "\"#{out}\""
# puts will show that this is a string with a \n in it.
# but he who knows the ruby string rules well enough to do this in the input may win a beer at the ...
# puts @string_input
@parse_output = {:string=>out} #chop quotes off
@transform_output = Ast::StringExpression.new(out)
@parser = @parser.string
end
def test_assignment def test_assignment
@string_input = "a = 5" @string_input = "a = 5"
@parse_output = { :asignee => { :name=>"a" } , :asigned => { :integer => "5" } } @parse_output = { :asignee => { :name=>"a" } , :asigned => { :integer => "5" } }