tests/test-command-template.t
changeset 31926 932241b8c644
parent 31887 f7b3677f66cd
child 31927 2abc556dbe92
--- a/tests/test-command-template.t	Wed Apr 05 22:28:09 2017 +0900
+++ b/tests/test-command-template.t	Mon Apr 03 22:54:06 2017 +0900
@@ -3404,6 +3404,22 @@
   $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
   no
 
+Test dict constructor:
+
+  $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
+  y=f7769ec2ab97 x=0
+  $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
+  x=0
+  y=f7769ec2ab97
+  $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
+  {"x": 0, "y": "f7769ec2ab97"}
+  $ hg log -r 0 -T '{dict()|json}\n'
+  {}
+
+  $ hg log -r 0 -T '{dict(x=rev, x=node)}'
+  hg: parse error: dict got multiple values for keyword argument 'x'
+  [255]
+
 Test get function:
 
   $ hg log -r 0 --template '{get(extras, "branch")}\n'