# HG changeset patch # User Martin von Zweigbergk # Date 2020-07-24 05:06:36 # Node ID f512708a9ea8dd045cecbf508d4c12a5b95f064e # Parent be1ab47d90f1d9055325fcb9e5cefff74c22a3e8 tests: add tests trying to use dir as style, as %include, and as __base__ Differential Revision: https://phab.mercurial-scm.org/D8800 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 @@ -133,6 +133,14 @@ Test map inheritance with non-existent b (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 @@ BROKEN: This should probably be an error $ 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 @@ Error if no style: 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