diff options
| author | Eric Ludlam | 2019-10-14 20:52:52 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-10-15 11:08:18 -0400 |
| commit | 57a786db5a5c653172f994ff707f8eded3d92168 (patch) | |
| tree | 09309ddc82e4202f7ee11b9539f5c0acc5d09a49 /etc/srecode | |
| parent | 3f8915a0192fe629dc985909c4acd5f80aa78b60 (diff) | |
| download | emacs-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.srt | 37 | ||||
| -rw-r--r-- | etc/srecode/test.srt | 76 |
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 | |||
| 22 | set mode "srecode-template-mode" | ||
| 23 | set escape_start "{{" | ||
| 24 | set escape_end "}}" | ||
| 25 | |||
| 26 | set application "tests" | ||
| 27 | set project "/tmp/" | ||
| 28 | |||
| 29 | context test | ||
| 30 | |||
| 31 | template test-project | ||
| 32 | "A template that only exists for files in /tmp." | ||
| 33 | ---- | ||
| 34 | Contents 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 | |||
| 83 | template inlinetext | 83 | template 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 | ||
| 89 | template includable :blank | 89 | template 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 | ||
| 101 | template wrapinclude-around | 101 | template wrapinclude-around |
| 102 | sectiondictionary "WI1" | ||
| 103 | set 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$ | |||
| 145 | INSIDE SECTION: $#A$$UTESTVAR1$$/A$ | 147 | INSIDE SECTION: $#A$$UTESTVAR1$$/A$ |
| 146 | ---- | 148 | ---- |
| 147 | 149 | ||
| 150 | template custom-arg-w-arg :utestwitharg | ||
| 151 | ---- | ||
| 152 | Value of xformed UTWA: $UTESTARGXFORM$ | ||
| 153 | ---- | ||
| 154 | |||
| 155 | template custom-arg-w-subdict :utestwitharg | ||
| 156 | sectiondictionary "UTLOOP" | ||
| 157 | set NAME "item1" | ||
| 158 | sectiondictionary "UTLOOP" | ||
| 159 | set NAME "item2" | ||
| 160 | sectiondictionary "UTLOOP" | ||
| 161 | set NAME "item3" | ||
| 162 | ---- | ||
| 163 | All items here: $FOO_item1$ $FOO_item2$ $FOO_item3$ | ||
| 164 | ---- | ||
| 165 | |||
| 166 | template nested-dictionary-syntax-flat | ||
| 167 | section "TOP" | ||
| 168 | show SUB | ||
| 169 | set NAME "item1" | ||
| 170 | end | ||
| 171 | ---- | ||
| 172 | $#TOP$$#SUB$sub $/SUB$$NAME$$/TOP$ | ||
| 173 | ---- | ||
| 174 | |||
| 175 | template nested-dictionary-syntax-nesting | ||
| 176 | section "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 | ||
| 203 | end | ||
| 204 | ---- | ||
| 205 | $#TOP$$#SUB$$NAME$$#SUB$-$NAME$$/SUB$ $/SUB$$/TOP$ | ||
| 206 | ---- | ||
| 207 | |||
| 208 | template nested-dictionary-syntax-mixed | ||
| 209 | section "TOP" | ||
| 210 | show SUB | ||
| 211 | set NAME "item1" | ||
| 212 | end | ||
| 213 | sectiondictionary "SECTION" | ||
| 214 | show SUB | ||
| 215 | set NAME "item2" | ||
| 216 | ---- | ||
| 217 | $#TOP$$NAME$$/TOP$ $#SECTION$$NAME$$/SECTION$ | ||
| 218 | ---- | ||
| 219 | |||
| 148 | ;; end | 220 | ;; end |