Mercurial > public > mercurial-scm > hg
diff tests/test-command-template.t @ 26215:72aad184f061
templater: create string unescape helper (issue4798)
This gives us a unified place to do error-handling of string-escaping
syntax errors
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 09 Sep 2015 14:43:45 -0700 |
parents | 662ea52d5dca |
children | 3095b1027661 |
line wrap: on
line diff
--- a/tests/test-command-template.t Sat Sep 05 16:50:35 2015 +0900 +++ b/tests/test-command-template.t Wed Sep 09 14:43:45 2015 -0700 @@ -2936,10 +2936,10 @@ hg: parse error at 21: unterminated string [255] $ hg log -r 2 -T '{if(rev, \"\\"")}\n' - hg: parse error at 11: syntax error + hg: parse error: trailing \ in string [255] $ hg log -r 2 -T '{if(rev, r\"\\"")}\n' - hg: parse error at 12: syntax error + hg: parse error: trailing \ in string [255] $ cd .. @@ -3417,3 +3417,12 @@ $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a 1200000.00 1300000.00 + +Test broken string escapes: + + $ hg log -T "bogus\\" -R a + hg: parse error: trailing \ in string + [255] + $ hg log -T "\\xy" -R a + hg: parse error: invalid \x escape + [255]