From: shdown Date: Wed, 25 Mar 2015 19:55:26 +0000 (+0300) Subject: Add tests for backslash unescaping X-Git-Tag: 4.10.1~14^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4e871c75f9b3ed4fd91cf534bac218a339f313ea;p=i3%2Fi3 Add tests for backslash unescaping --- diff --git a/testcases/t/187-commands-parser.t b/testcases/t/187-commands-parser.t index 5ee94f87..6d67731a 100644 --- a/testcases/t/187-commands-parser.t +++ b/testcases/t/187-commands-parser.t @@ -156,7 +156,7 @@ is(parser_calls('move something to somewhere'), 'error for unknown literal ok'); ################################################################################ -# 3: Verify that escaping of double quotes works correctly +# 3: Verify that escaping works correctly ################################################################################ is(parser_calls('workspace "foo"'), @@ -171,6 +171,18 @@ is(parser_calls('workspace "foo \"bar"'), 'cmd_workspace_name(foo "bar)', 'Command with escaped double quotes ok'); +is(parser_calls('workspace "foo \\'), + 'cmd_workspace_name(foo \\)', + 'Command with single backslash in the end ok'); + +is(parser_calls('workspace "foo\\\\bar"'), + 'cmd_workspace_name(foo\\bar)', + 'Command with escaped backslashes ok'); + +is(parser_calls('workspace "foo\\\\\\"bar"'), + 'cmd_workspace_name(foo\\"bar)', + 'Command with escaped double quotes after escaped backslashes ok'); + ################################################################################ # 4: Verify that resize commands with a "px or ppt"-construction are parsed # correctly