@@ -68,5 +68,32 @@ def test_inspect_multiline_expression
6868 send_cont
6969 end
7070
71+ def test_inspect_unescaping_escaped_newlines
72+ create_socket [ "sleep 0.1" ]
73+ run_to_line ( 1 )
74+
75+ send_ruby ( 'v inspect "\\\\n".size' )
76+ variables = read_variables
77+ assert_equal ( 1 , variables . length , "There is one variable returned." )
78+ assert_equal ( "1" , variables [ 0 ] . value , "There is one char (newline)" )
79+
80+ send_ruby ( 'v inspect "\\\\\\n".size' )
81+ variables = read_variables
82+ assert_equal ( 1 , variables . length , "There is one variable returned." )
83+ assert_equal ( "0" , variables [ 0 ] . value , "There are no chars, it's line continuation here" )
84+
85+ send_ruby ( 'v inspect "\\\\\\\\\\n".size' )
86+ variables = read_variables
87+ assert_equal ( 1 , variables . length , "There is one variable returned." )
88+ assert_equal ( "2" , variables [ 0 ] . value , "There are two chars: escaped backslash and newline" )
89+
90+ send_ruby ( 'v inspect \'"\\\\n\'.size' )
91+ variables = read_variables
92+ assert_equal ( 1 , variables . length , "There is one variable returned." )
93+ assert_equal ( "3" , variables [ 0 ] . value , "There are three chars: quote, backslash and n" )
94+
95+ send_cont
96+ end
97+
7198end
7299
0 commit comments