diff --git a/test/parser/test_basic.rb b/test/parser/test_basic.rb index a178ecd5..aae32e71 100644 --- a/test/parser/test_basic.rb +++ b/test/parser/test_basic.rb @@ -32,6 +32,18 @@ class TestBasic < MiniTest::Test @parser = @parser.string 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 @string_input = "a = 5" @parse_output = { :asignee => { :name=>"a" } , :asigned => { :integer => "5" } }