Patchwork D8800: tests: add tests trying to use dir as style, as %include, and as __base__

login
register
mail settings
Submitter phabricator
Date July 23, 2020, 5:28 p.m.
Message ID <differential-rev-PHID-DREV-zalcugavpkumr7bvjo7h-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46851/
State Superseded
Headers show

Comments

phabricator - July 23, 2020, 5:28 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8800

AFFECTED FILES
  tests/test-template-map.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-template-map.t b/tests/test-template-map.t
--- a/tests/test-template-map.t
+++ b/tests/test-template-map.t
@@ -128,12 +128,19 @@ 
 Test map inheritance with non-existent base
 
   $ echo "__base__ = non-existent" > map-base-nonexistent
-  $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
   $ hg log -l1 -T./map-base-nonexistent
   abort: style '$TESTTMP/a/non-existent' not found
   (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
@@ -156,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
@@ -1252,6 +1270,10 @@ 
   (available styles: bisect, changelog, compact, default, phases, show, status, xml)
   [255]
 
+  $ hg log --style somedir
+  abort: Is a directory: 'somedir'
+  [255]
+
   $ hg log -T list
   available styles: bisect, changelog, compact, default, phases, show, status, xml
   abort: specify a template