##// END OF EJS Templates
templater: reject bad fillchar argument passed to pad()...
Yuya Nishihara -
r31519:3725986b default
parent child Browse files
Show More
@@ -575,6 +575,9 b' def pad(context, mapping, args):'
575 575 fillchar = ' '
576 576 if len(args) > 2:
577 577 fillchar = evalstring(context, mapping, args[2])
578 if len(fillchar) != 1:
579 # i18n: "pad" is a keyword
580 raise error.ParseError(_("pad() expects a single fill character"))
578 581 if len(args) > 3:
579 582 left = evalboolean(context, mapping, args[3])
580 583
@@ -3521,6 +3521,15 b' Test width argument passed to pad functi'
3521 3521 hg: parse error: pad() expects an integer width
3522 3522 [255]
3523 3523
3524 Test invalid fillchar passed to pad function
3525
3526 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
3527 hg: parse error: pad() expects a single fill character
3528 [255]
3529 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
3530 hg: parse error: pad() expects a single fill character
3531 [255]
3532
3524 3533 Test boolean argument passed to pad function
3525 3534
3526 3535 no crash
General Comments 0
You need to be logged in to leave comments. Login now