comparison tests/test-template-map.t @ 45207:4489e9a22763

tests: add test for bad template %include and __base__ It doesn't seem like we had any tests for `%include non-existent` and `__base__ = non-existent`. The latter raises an error while the former ignores the include. We should probably also make the former an error. Differential Revision: https://phab.mercurial-scm.org/D8798
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 22 Jul 2020 22:38:42 -0700
parents db0be4678399
children be1ab47d90f1
comparison
equal deleted inserted replaced
45206:db0be4678399 45207:4489e9a22763
123 tag: tip 123 tag: tip
124 user: test 124 user: test
125 date: Wed Jan 01 10:01:00 2020 +0000 125 date: Wed Jan 01 10:01:00 2020 +0000
126 summary: third 126 summary: third
127 127
128 Test map inheritance with non-existent base
129
130 $ echo "__base__ = non-existent" > map-base-nonexistent
131 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
132 $ hg log -l1 -T./map-base-nonexistent
133 abort: style '$TESTTMP/a/non-existent' not found
134 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
135 [255]
136
128 Test including a built-in template map 137 Test including a built-in template map
129 138
130 $ cat <<'EOF' > map-include-builtin 139 $ cat <<'EOF' > map-include-builtin
131 > %include map-cmdline.default 140 > %include map-cmdline.default
132 > [templates] 141 > [templates]
133 > changeset = "{changeset_quiet}\n" 142 > changeset = "{changeset_quiet}\n"
134 > EOF 143 > EOF
135 $ hg log -l1 -T./map-include-builtin 144 $ hg log -l1 -T./map-include-builtin
136 8:95c24699272e 145 8:95c24699272e
137 146
147
148 Test including a nonexistent template map
149 BROKEN: This should probably be an error just like the bad __base__ above
150
151 $ cat <<'EOF' > map-include-nonexistent
152 > %include nonexistent
153 > [templates]
154 > changeset = "test\n"
155 > EOF
156 $ hg log -l1 -T./map-include-nonexistent
157 test
138 158
139 Test docheader, docfooter and separator in template map 159 Test docheader, docfooter and separator in template map
140 160
141 $ cat <<'EOF' > map-myjson 161 $ cat <<'EOF' > map-myjson
142 > docheader = '\{\n' 162 > docheader = '\{\n'