diff tests/test-revset.t @ 12408:78a97859b90d

revset: support raw string literals This adds support for r'...' and r"..." as string literals. Strings with the "r" prefix will not have their escape characters interpreted. This is especially useful for grep(), where, with regular string literals, \number is interpreted as an octal escape code, and \b is interpreted as the backspace character (\x08).
author Brodie Rao <brodie@bitheap.org>
date Fri, 24 Sep 2010 15:36:53 -0500
parents 11db6fa2961e
children e797fdf91df4
line wrap: on
line diff
--- a/tests/test-revset.t	Sun Sep 26 13:11:31 2010 -0500
+++ b/tests/test-revset.t	Fri Sep 24 15:36:53 2010 -0500
@@ -215,6 +215,14 @@
   ('func', ('symbol', 'grep'), ('string', '('))
   hg: parse error: invalid match pattern: unbalanced parenthesis
   [255]
+  $ try 'grep("\bissue\d+")'
+  ('func', ('symbol', 'grep'), ('string', '\x08issue\\d+'))
+  $ try 'grep(r"\bissue\d+")'
+  ('func', ('symbol', 'grep'), ('string', '\\bissue\\d+'))
+  6
+  $ try 'grep(r"\")'
+  hg: parse error at 7: unterminated string
+  [255]
   $ log 'head()'
   0
   1