diff tests/test-command-template.t @ 28346:542d200bd261

templater: fix shortest() to evaluate int argument and handle error
author Yuya Nishihara <yuya@tcha.org>
date Sun, 14 Feb 2016 13:09:17 +0900
parents d81437c91a26
children 7cb2f2438f85
line wrap: on
line diff
--- a/tests/test-command-template.t	Sun Feb 14 13:05:09 2016 +0900
+++ b/tests/test-command-template.t	Sun Feb 14 13:09:17 2016 +0900
@@ -3219,6 +3219,12 @@
   $ hg log --template '{node|shortest}\n' -l1
   e777
 
+  $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
+  f7769ec2ab
+  $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
+  hg: parse error: shortest() expects an integer minlength
+  [255]
+
 Test pad function
 
   $ hg log --template '{pad(rev, 20)} {author|user}\n'