Mercurial > public > mercurial-scm > hg
diff tests/test-command-template.t @ 28345:d81437c91a26
templater: fix pad() to evaluate int argument and handle error
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 14 Feb 2016 13:05:09 +0900 |
parents | ac371d4c007f |
children | 542d200bd261 |
line wrap: on
line diff
--- a/tests/test-command-template.t Sun Feb 14 12:48:14 2016 +0900 +++ b/tests/test-command-template.t Sun Feb 14 13:05:09 2016 +0900 @@ -3244,6 +3244,14 @@ $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n' \{rev} test +Test width argument passed to pad function + + $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n' + 0 test + $ hg log -r 0 -T '{pad(rev, "not an int")}\n' + hg: parse error: pad() expects an integer width + [255] + Test ifcontains function $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'