aboutsummaryrefslogtreecommitdiffstats
path: root/etc/srecode
diff options
context:
space:
mode:
authorEric Ludlam2019-10-14 20:52:52 -0400
committerStefan Monnier2019-10-15 11:08:18 -0400
commit57a786db5a5c653172f994ff707f8eded3d92168 (patch)
tree09309ddc82e4202f7ee11b9539f5c0acc5d09a49 /etc/srecode
parent3f8915a0192fe629dc985909c4acd5f80aa78b60 (diff)
downloademacs-57a786db5a5c653172f994ff707f8eded3d92168.tar.gz
emacs-57a786db5a5c653172f994ff707f8eded3d92168.zip
Adapt the CEDET SRecoder template test to use ERT
These tests were copied from CEDET from SourceForge. Author: Eric Ludlam <zappo@gnu.org>
Diffstat (limited to 'etc/srecode')
-rw-r--r--etc/srecode/proj-test.srt37
-rw-r--r--etc/srecode/test.srt76
2 files changed, 111 insertions, 2 deletions
diff --git a/etc/srecode/proj-test.srt b/etc/srecode/proj-test.srt
new file mode 100644
index 00000000000..c97016fc448
--- /dev/null
+++ b/etc/srecode/proj-test.srt
@@ -0,0 +1,37 @@
1;; proj-test.srt --- SRecode template for testing project scoping.
2
3;; Copyright (C) 2008-2019 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <zappo@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
21
22set mode "srecode-template-mode"
23set escape_start "{{"
24set escape_end "}}"
25
26set application "tests"
27set project "/tmp/"
28
29context test
30
31template test-project
32"A template that only exists for files in /tmp."
33----
34Contents doesn't matter.
35----
36
37;; end
diff --git a/etc/srecode/test.srt b/etc/srecode/test.srt
index 3bbc33e72dc..9689f8f111f 100644
--- a/etc/srecode/test.srt
+++ b/etc/srecode/test.srt
@@ -83,13 +83,13 @@ template gapsomething :blank
83template inlinetext 83template inlinetext
84"Insert text that has no newlines" 84"Insert text that has no newlines"
85---- 85----
86 *In the middle* 86*In the middle*
87---- 87----
88 88
89template includable :blank 89template includable :blank
90---- 90----
91;; An includable $COMMENT$ we could use. 91;; An includable $COMMENT$ we could use.
92;; $^$ 92;; $INPUTNAME$$^$
93;; Text after a point inserter. 93;; Text after a point inserter.
94---- 94----
95 95
@@ -99,6 +99,8 @@ $>WI1:includable$
99---- 99----
100 100
101template wrapinclude-around 101template wrapinclude-around
102sectiondictionary "WI1"
103set INPUTNAME "[VAR]"
102---- 104----
103$<WI1:includable$Intermediate Comments$/WI1$ 105$<WI1:includable$Intermediate Comments$/WI1$
104---- 106----
@@ -145,4 +147,74 @@ OUTSIDE SECTION: $UTESTVAR1$
145INSIDE SECTION: $#A$$UTESTVAR1$$/A$ 147INSIDE SECTION: $#A$$UTESTVAR1$$/A$
146---- 148----
147 149
150template custom-arg-w-arg :utestwitharg
151----
152Value of xformed UTWA: $UTESTARGXFORM$
153----
154
155template custom-arg-w-subdict :utestwitharg
156sectiondictionary "UTLOOP"
157set NAME "item1"
158sectiondictionary "UTLOOP"
159set NAME "item2"
160sectiondictionary "UTLOOP"
161set NAME "item3"
162----
163All items here: $FOO_item1$ $FOO_item2$ $FOO_item3$
164----
165
166template nested-dictionary-syntax-flat
167section "TOP"
168 show SUB
169 set NAME "item1"
170end
171----
172$#TOP$$#SUB$sub $/SUB$$NAME$$/TOP$
173----
174
175template nested-dictionary-syntax-nesting
176section "TOP"
177 show SHOW1
178 set NAME "item1"
179 section "SUB"
180 show SHOW11
181 set NAME "item11"
182 end
183 show SHOW2
184 set NAME "item2"
185 section "SUB"
186 show SHOW21
187 set NAME "item21"
188 end
189 show SHOW3
190 set NAME "item3"
191 section "SUB"
192 show SHOW11
193 set NAME "item31"
194 section "SUB"
195 show SHOW311
196 set NAME "item311"
197 end
198 section "SUB"
199 show SHOW321
200 set NAME "item321"
201 end
202 end
203end
204----
205$#TOP$$#SUB$$NAME$$#SUB$-$NAME$$/SUB$ $/SUB$$/TOP$
206----
207
208template nested-dictionary-syntax-mixed
209section "TOP"
210 show SUB
211 set NAME "item1"
212end
213sectiondictionary "SECTION"
214show SUB
215set NAME "item2"
216----
217$#TOP$$NAME$$/TOP$ $#SECTION$$NAME$$/SECTION$
218----
219
148;; end 220;; end