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
--- 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