diff tests/test-command-template.t @ 38227:1c8098cf560a

templater: always join() over a wrapped object (BC) This is a behavior change in a sense that join() of a byte string is no longer "implementation dependent." Before, if a byte string was backed by a lazy generator, join() would concatenate each chunk with the specified separator, which seems wrong. The new behavior is always join() each byte. TypeError on join() over uniterable is also fixed.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 21 Apr 2018 17:00:21 +0900
parents 3ea3c96ada54
children 8bded7eae26c
line wrap: on
line diff
--- a/tests/test-command-template.t	Tue Mar 20 23:56:26 2018 +0900
+++ b/tests/test-command-template.t	Sat Apr 21 17:00:21 2018 +0900
@@ -3249,6 +3249,17 @@
   $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
   default
 
+Test join() over string
+
+  $ hg log -R latesttag -r tip -T '{join(rev|stringify, ".")}\n'
+  1.1
+
+Test join() over uniterable
+
+  $ hg log -R latesttag -r tip -T '{join(rev, "")}\n'
+  hg: parse error: 11 is not iterable
+  [255]
+
 Test min/max of integers
 
   $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'