diff tests/test-command-template.t @ 35680:077ee15b8493

templater: make sure expression is terminated by '}' This can't be ensured by the tokenize() generator since the parser stop consuming tokens once it reached an end of an operation. Spotted by Matt Harbison.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 16 Jan 2018 21:42:42 +0900
parents 468d7a1f6633
children 8685192a8733
line wrap: on
line diff
--- a/tests/test-command-template.t	Fri Jul 14 19:59:10 2017 +0200
+++ b/tests/test-command-template.t	Tue Jan 16 21:42:42 2018 +0900
@@ -2756,6 +2756,15 @@
   $ hg log -T '{date'
   hg: parse error at 1: unterminated template expansion
   [255]
+  $ hg log -T '{date(}'
+  hg: parse error at 7: not a prefix: end
+  [255]
+  $ hg log -T '{date)}'
+  hg: parse error at 5: invalid token
+  [255]
+  $ hg log -T '{date date}'
+  hg: parse error at 6: invalid token
+  [255]
 
 Behind the scenes, this will throw TypeError