Debian Codegraph @

tests/languages/plant-uml/keyword_feature.test

raw
1 if "Some Test" then
2 -->[true] "Some Action"
3 --> "Another Action"
4 -right-> (*)
5 else
6 ->[false] "Something else"
7 -->[Ending process] (*)
8 endif
9
10 if (Graphviz installed?) then (yes)
11 :process all\ndiagrams;
12 else (no)
13 :process only
14 __sequence__ and __activity__ diagrams;
15 endif
16
17 if (color?) is (<color:red>red) then
18 :print red;
19 else
20 :print not red;
21
22 if (counter?) equals (5) then
23 :print 5;
24 else
25 :print not 5;
26
27 start
28 if (condition A) then (yes)
29 :Text 1;
30 elseif (condition B) then (yes)
31 :Text 2;
32 stop
33 (no) elseif (condition C) then (yes)
34 :Text 3;
35 (no) elseif (condition D) then (yes)
36 :Text 4;
37 else (nothing)
38 :Text else;
39 endif
40 stop
41
42 switch (test?)
43 case ( condition A )
44 :Text 1;
45 case ( condition B )
46 :Text 2;
47 case ( condition C )
48 :Text 3;
49 case ( condition D )
50 :Text 4;
51 case ( condition E )
52 :Text 5;
53 endswitch
54
55 repeat
56 :read data;
57 :generate diagrams;
58 repeat while (more data?) is (yes)
59 ->no;
60
61 repeat while (Something went wrong with long text?) is (yes) not (no)
62 ->//merged step//;
63
64 ----------------------------------------------------
65
66 [
67 ["keyword", "if"],
68 ["string", "\"Some Test\""],
69 ["keyword", "then"],
70
71 ["arrow", ["-->"]],
72 ["punctuation", "["],
73 "true",
74 ["punctuation", "]"],
75 ["string", "\"Some Action\""],
76
77 ["arrow", ["-->"]],
78 ["string", "\"Another Action\""],
79
80 ["arrow", ["-right->"]],
81 ["punctuation", "("],
82 "*",
83 ["punctuation", ")"],
84
85 ["keyword", "else"],
86
87 ["arrow", ["->"]],
88 ["punctuation", "["],
89 "false",
90 ["punctuation", "]"],
91 ["string", "\"Something else\""],
92
93 ["arrow", ["-->"]],
94 ["punctuation", "["],
95 "Ending process",
96 ["punctuation", "]"],
97 ["punctuation", "("],
98 "*",
99 ["punctuation", ")"],
100
101 ["keyword", "endif"],
102
103 ["keyword", "if"],
104 ["punctuation", "("],
105 "Graphviz installed?",
106 ["punctuation", ")"],
107 ["keyword", "then"],
108 ["punctuation", "("],
109 "yes",
110 ["punctuation", ")"],
111
112 ["punctuation", ":"],
113 "process all\\ndiagrams",
114 ["punctuation", ";"],
115
116 ["keyword", "else"],
117 ["punctuation", "("],
118 "no",
119 ["punctuation", ")"],
120
121 ["punctuation", ":"],
122 "process only\r\n __sequence__ and __activity__ diagrams",
123 ["punctuation", ";"],
124
125 ["keyword", "endif"],
126
127 ["keyword", "if"],
128 ["punctuation", "("],
129 "color?",
130 ["punctuation", ")"],
131 ["keyword", "is"],
132 ["punctuation", "("],
133 "<color",
134 ["punctuation", ":"],
135 "red>red",
136 ["punctuation", ")"],
137 ["keyword", "then"],
138
139 ["punctuation", ":"],
140 "print red",
141 ["punctuation", ";"],
142
143 ["keyword", "else"],
144
145 ["punctuation", ":"],
146 "print not red",
147 ["punctuation", ";"],
148
149 ["keyword", "if"],
150 ["punctuation", "("],
151 "counter?",
152 ["punctuation", ")"],
153 ["keyword", "equals"],
154 ["punctuation", "("],
155 "5",
156 ["punctuation", ")"],
157 ["keyword", "then"],
158
159 ["punctuation", ":"],
160 "print 5",
161 ["punctuation", ";"],
162
163 ["keyword", "else"],
164
165 ["punctuation", ":"],
166 "print not 5",
167 ["punctuation", ";"],
168
169 ["keyword", "start"],
170
171 ["keyword", "if"],
172 ["punctuation", "("],
173 "condition A",
174 ["punctuation", ")"],
175 ["keyword", "then"],
176 ["punctuation", "("],
177 "yes",
178 ["punctuation", ")"],
179
180 ["punctuation", ":"],
181 "Text 1",
182 ["punctuation", ";"],
183
184 ["keyword", "elseif"],
185 ["punctuation", "("],
186 "condition B",
187 ["punctuation", ")"],
188 ["keyword", "then"],
189 ["punctuation", "("],
190 "yes",
191 ["punctuation", ")"],
192
193 ["punctuation", ":"],
194 "Text 2",
195 ["punctuation", ";"],
196
197 ["keyword", "stop"],
198
199 ["punctuation", "("],
200 "no",
201 ["punctuation", ")"],
202 ["keyword", "elseif"],
203 ["punctuation", "("],
204 "condition C",
205 ["punctuation", ")"],
206 ["keyword", "then"],
207 ["punctuation", "("],
208 "yes",
209 ["punctuation", ")"],
210
211 ["punctuation", ":"],
212 "Text 3",
213 ["punctuation", ";"],
214
215 ["punctuation", "("],
216 "no",
217 ["punctuation", ")"],
218 ["keyword", "elseif"],
219 ["punctuation", "("],
220 "condition D",
221 ["punctuation", ")"],
222 ["keyword", "then"],
223 ["punctuation", "("],
224 "yes",
225 ["punctuation", ")"],
226
227 ["punctuation", ":"],
228 "Text 4",
229 ["punctuation", ";"],
230
231 ["keyword", "else"],
232 ["punctuation", "("],
233 "nothing",
234 ["punctuation", ")"],
235
236 ["punctuation", ":"],
237 "Text else",
238 ["punctuation", ";"],
239
240 ["keyword", "endif"],
241
242 ["keyword", "stop"],
243
244 ["keyword", "switch"],
245 ["punctuation", "("],
246 "test?",
247 ["punctuation", ")"],
248
249 ["keyword", "case"],
250 ["punctuation", "("],
251 " condition A ",
252 ["punctuation", ")"],
253
254 ["punctuation", ":"],
255 "Text 1",
256 ["punctuation", ";"],
257
258 ["keyword", "case"],
259 ["punctuation", "("],
260 " condition B ",
261 ["punctuation", ")"],
262
263 ["punctuation", ":"],
264 "Text 2",
265 ["punctuation", ";"],
266
267 ["keyword", "case"],
268 ["punctuation", "("],
269 " condition C ",
270 ["punctuation", ")"],
271
272 ["punctuation", ":"],
273 "Text 3",
274 ["punctuation", ";"],
275
276 ["keyword", "case"],
277 ["punctuation", "("],
278 " condition D ",
279 ["punctuation", ")"],
280
281 ["punctuation", ":"],
282 "Text 4",
283 ["punctuation", ";"],
284
285 ["keyword", "case"],
286 ["punctuation", "("],
287 " condition E ",
288 ["punctuation", ")"],
289
290 ["punctuation", ":"],
291 "Text 5",
292 ["punctuation", ";"],
293
294 ["keyword", "endswitch"],
295
296 ["keyword", "repeat"],
297
298 ["punctuation", ":"],
299 "read data",
300 ["punctuation", ";"],
301
302 ["punctuation", ":"],
303 "generate diagrams",
304 ["punctuation", ";"],
305
306 ["keyword", "repeat"],
307 ["keyword", "while"],
308 ["punctuation", "("],
309 "more data?",
310 ["punctuation", ")"],
311 ["keyword", "is"],
312 ["punctuation", "("],
313 "yes",
314 ["punctuation", ")"],
315
316 ["arrow", ["->"]],
317 "no",
318 ["punctuation", ";"],
319
320 ["keyword", "repeat"],
321 ["keyword", "while"],
322 ["punctuation", "("],
323 "Something went wrong with long text?",
324 ["punctuation", ")"],
325 ["keyword", "is"],
326 ["punctuation", "("],
327 "yes",
328 ["punctuation", ")"],
329 ["keyword", "not"],
330 ["punctuation", "("],
331 "no",
332 ["punctuation", ")"],
333
334 ["arrow", ["->"]],
335 "//merged step//",
336 ["punctuation", ";"]
337 ]