changeset 45222:f512708a9ea8

tests: add tests trying to use dir as style, as %include, and as __base__ Differential Revision: https://phab.mercurial-scm.org/D8800
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 23 Jul 2020 22:06:36 -0700
parents be1ab47d90f1
children d056a131c93f
files tests/test-template-map.t
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-template-map.t	Thu Jul 23 22:06:31 2020 -0700
+++ b/tests/test-template-map.t	Thu Jul 23 22:06:36 2020 -0700
@@ -133,6 +133,14 @@
   (available styles: bisect, changelog, compact, default, phases, show, status, xml)
   [255]
 
+Test map inheritance with directory as base
+
+  $ mkdir somedir
+  $ echo "__base__ = somedir" > map-base-dir
+  $ hg log -l1 -T./map-base-dir
+  abort: Is a directory: '$TESTTMP/a/somedir'
+  [255]
+
 Test including a built-in template map
 
   $ cat <<'EOF' > map-include-builtin
@@ -155,6 +163,17 @@
   $ hg log -l1 -T./map-include-nonexistent
   test
 
+Test including a directory as template map
+BROKEN: This should probably be an error just like the bad __base__ above
+
+  $ cat <<'EOF' > map-include-dir
+  > %include somedir
+  > [templates]
+  > changeset = "test\n"
+  > EOF
+  $ hg log -l1 -T./map-include-dir
+  test
+
 Test docheader, docfooter and separator in template map
 
   $ cat <<'EOF' > map-myjson
@@ -1256,6 +1275,12 @@
   abort: specify a template
   [255]
 
+Error if style is a directory:
+
+  $ hg log --style somedir
+  abort: Is a directory: 'somedir'
+  [255]
+
 Error if style missing key:
 
   $ echo 'q = q' > t