# HG changeset patch # User Martin von Zweigbergk # Date 1573841782 28800 # Node ID 0fd9e7a1cf36aa74ea2c2f058cef08ccc11d0f2b # Parent f0b33e5f0cf4a2d38e2f648da0680253479f4402 tests: document behavior of indent() with empty first line indent() is documented to indent all non-empty lines, but it still indents the first line even if it's empty. Let's have tests for that. Differential Revision: https://phab.mercurial-scm.org/D7431 diff -r f0b33e5f0cf4 -r 0fd9e7a1cf36 tests/test-template-functions.t --- a/tests/test-template-functions.t Sat Nov 16 12:08:02 2019 -0800 +++ b/tests/test-template-functions.t Fri Nov 15 10:16:22 2019 -0800 @@ -1504,6 +1504,21 @@ >> other 3 +Test indent with empty first line + + $ hg version -T "{indent('', '>> ')}\n" + >> + + $ hg version -T "{indent(' + > second', '>> ')}\n" + >> + >> second + + $ hg version -T "{indent(' + > second', '>> ', ' > ')}\n" + > + >> second + Test with non-strings like dates $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a