Debian Codegraph @

tests/languages/mermaid/full_statediagram.test

raw
1 stateDiagram-v2
2 [*] --> Still
3 Still --> [*]
4
5 Still --> Moving
6 Moving --> Still
7 Moving --> Crash
8 Crash --> [*]
9
10 stateDiagram-v2
11 s1 --> s2
12
13 stateDiagram-v2
14 s1 --> s2: A transition
15
16 stateDiagram-v2
17 [*] --> s1
18 s1 --> [*]
19
20 stateDiagram-v2
21 [*] --> First
22 state First {
23 [*] --> second
24 second --> [*]
25 }
26
27 stateDiagram-v2
28 [*] --> First
29
30 state First {
31 [*] --> Second
32
33 state Second {
34 [*] --> second
35 second --> Third
36
37 state Third {
38 [*] --> third
39 third --> [*]
40 }
41 }
42 }
43
44 stateDiagram-v2
45 [*] --> First
46 First --> Second
47 First --> Third
48
49 state First {
50 [*] --> fir
51 fir --> [*]
52 }
53 state Second {
54 [*] --> sec
55 sec --> [*]
56 }
57 state Third {
58 [*] --> thi
59 thi --> [*]
60 }
61
62 stateDiagram-v2
63 state if_state <<choice>>
64 [*] --> IsPositive
65 IsPositive --> if_state
66 if_state --> False: if n < 0
67 if_state --> True : if n >= 0
68
69 stateDiagram-v2
70 state fork_state <<fork>>
71 [*] --> fork_state
72 fork_state --> State2
73 fork_state --> State3
74
75 state join_state <<join>>
76 State2 --> join_state
77 State3 --> join_state
78 join_state --> State4
79 State4 --> [*]
80
81 stateDiagram-v2
82 State1: The state with a note
83 note right of State1
84 Important information! You can write
85 notes.
86 end note
87 State1 --> State2
88 note left of State2 : This is the note to the left.
89
90 stateDiagram-v2
91 [*] --> Active
92
93 state Active {
94 [*] --> NumLockOff
95 NumLockOff --> NumLockOn : EvNumLockPressed
96 NumLockOn --> NumLockOff : EvNumLockPressed
97 --
98 [*] --> CapsLockOff
99 CapsLockOff --> CapsLockOn : EvCapsLockPressed
100 CapsLockOn --> CapsLockOff : EvCapsLockPressed
101 --
102 [*] --> ScrollLockOff
103 ScrollLockOff --> ScrollLockOn : EvScrollLockPressed
104 ScrollLockOn --> ScrollLockOff : EvScrollLockPressed
105 }
106
107 stateDiagram
108 direction LR
109 [*] --> A
110 A --> B
111 B --> C
112 state B {
113 direction LR
114 a --> b
115 }
116 B --> D
117
118 stateDiagram-v2
119 [*] --> Still
120 Still --> [*]
121 %% this is a comment
122 Still --> Moving
123 Moving --> Still %% another comment
124 Moving --> Crash
125 Crash --> [*]
126
127 ----------------------------------------------------
128
129 [
130 ["keyword", "stateDiagram-v2"],
131
132 ["text", "[*]"],
133 ["arrow", "-->"],
134 " Still\r\n Still ",
135 ["arrow", "-->"],
136 ["text", "[*]"],
137
138 "\r\n\r\n Still ",
139 ["arrow", "-->"],
140 " Moving\r\n Moving ",
141 ["arrow", "-->"],
142 " Still\r\n Moving ",
143 ["arrow", "-->"],
144 " Crash\r\n Crash ",
145 ["arrow", "-->"],
146 ["text", "[*]"],
147
148 ["keyword", "stateDiagram-v2"],
149 "\r\n s1 ", ["arrow", "-->"], " s2\r\n\r\n",
150
151 ["keyword", "stateDiagram-v2"],
152
153 "\r\n s1 ",
154 ["arrow", "-->"],
155 " s2",
156 ["operator", ":"],
157 " A transition\r\n\r\n",
158
159 ["keyword", "stateDiagram-v2"],
160
161 ["text", "[*]"],
162 ["arrow", "-->"],
163 " s1\r\n s1 ",
164 ["arrow", "-->"],
165 ["text", "[*]"],
166
167 ["keyword", "stateDiagram-v2"],
168
169 ["text", "[*]"],
170 ["arrow", "-->"],
171 " First\r\n ",
172
173 ["keyword", "state"],
174 " First ",
175 ["punctuation", "{"],
176
177 ["text", "[*]"],
178 ["arrow", "-->"],
179 " second\r\n second ",
180 ["arrow", "-->"],
181 ["text", "[*]"],
182
183 ["punctuation", "}"],
184
185 ["keyword", "stateDiagram-v2"],
186 ["text", "[*]"], ["arrow", "-->"], " First\r\n\r\n ",
187
188 ["keyword", "state"], " First ", ["punctuation", "{"],
189 ["text", "[*]"], ["arrow", "-->"], " Second\r\n\r\n ",
190
191 ["keyword", "state"],
192 " Second ",
193 ["punctuation", "{"],
194
195 ["text", "[*]"],
196 ["arrow", "-->"],
197 " second\r\n second ",
198 ["arrow", "-->"],
199 " Third\r\n\r\n ",
200
201 ["keyword", "state"],
202 " Third ",
203 ["punctuation", "{"],
204
205 ["text", "[*]"],
206 ["arrow", "-->"],
207 " third\r\n third ",
208 ["arrow", "-->"],
209 ["text", "[*]"],
210
211 ["punctuation", "}"],
212
213 ["punctuation", "}"],
214
215 ["punctuation", "}"],
216
217 ["keyword", "stateDiagram-v2"],
218
219 ["text", "[*]"],
220 ["arrow", "-->"],
221 " First\r\n First ",
222 ["arrow", "-->"],
223 " Second\r\n First ",
224 ["arrow", "-->"],
225 " Third\r\n\r\n ",
226
227 ["keyword", "state"],
228 " First ",
229 ["punctuation", "{"],
230
231 ["text", "[*]"],
232 ["arrow", "-->"],
233 " fir\r\n fir ",
234 ["arrow", "-->"],
235 ["text", "[*]"],
236
237 ["punctuation", "}"],
238
239 ["keyword", "state"],
240 " Second ",
241 ["punctuation", "{"],
242
243 ["text", "[*]"],
244 ["arrow", "-->"],
245 " sec\r\n sec ",
246 ["arrow", "-->"],
247 ["text", "[*]"],
248
249 ["punctuation", "}"],
250
251 ["keyword", "state"],
252 " Third ",
253 ["punctuation", "{"],
254
255 ["text", "[*]"],
256 ["arrow", "-->"],
257 " thi\r\n thi ",
258 ["arrow", "-->"],
259 ["text", "[*]"],
260
261 ["punctuation", "}"],
262
263 ["keyword", "stateDiagram-v2"],
264
265 ["keyword", "state"],
266 " if_state ",
267 ["annotation", "<<choice>>"],
268
269 ["text", "[*]"],
270 ["arrow", "-->"],
271 " IsPositive\r\n IsPositive ",
272 ["arrow", "-->"],
273 " if_state\r\n if_state ",
274 ["arrow", "-->"],
275 " False",
276 ["operator", ":"],
277 " if n < 0\r\n if_state ",
278 ["arrow", "-->"],
279 " True ",
280 ["operator", ":"],
281 " if n >= 0\r\n\r\n",
282
283 ["keyword", "stateDiagram-v2"],
284
285 ["keyword", "state"],
286 " fork_state ",
287 ["annotation", "<<fork>>"],
288
289 ["text", "[*]"],
290 ["arrow", "-->"],
291 " fork_state\r\n fork_state ",
292 ["arrow", "-->"],
293 " State2\r\n fork_state ",
294 ["arrow", "-->"],
295 " State3\r\n\r\n ",
296
297 ["keyword", "state"],
298 " join_state ",
299 ["annotation", "<<join>>"],
300
301 "\r\n State2 ",
302 ["arrow", "-->"],
303 " join_state\r\n State3 ",
304 ["arrow", "-->"],
305 " join_state\r\n join_state ",
306 ["arrow", "-->"],
307 " State4\r\n State4 ",
308 ["arrow", "-->"],
309 ["text", "[*]"],
310
311 ["keyword", "stateDiagram-v2"],
312
313 "\r\n State1",
314 ["operator", ":"],
315 " The state with a note\r\n ",
316
317 ["keyword", "note right of"],
318 " State1\r\n Important information! You can write\r\n notes.\r\n ",
319
320 ["keyword", "end note"],
321
322 "\r\n State1 ",
323 ["arrow", "-->"],
324 " State2\r\n ",
325
326 ["keyword", "note left of"],
327 " State2 ",
328 ["operator", ":"],
329 " This is the note to the left.\r\n\r\n",
330
331 ["keyword", "stateDiagram-v2"],
332 ["text", "[*]"], ["arrow", "-->"], " Active\r\n\r\n ",
333
334 ["keyword", "state"],
335 " Active ",
336 ["punctuation", "{"],
337
338 ["text", "[*]"],
339 ["arrow", "-->"],
340 " NumLockOff\r\n NumLockOff ",
341 ["arrow", "-->"],
342 " NumLockOn ",
343 ["operator", ":"],
344 " EvNumLockPressed\r\n NumLockOn ",
345 ["arrow", "-->"],
346 " NumLockOff ",
347 ["operator", ":"],
348 " EvNumLockPressed\r\n ",
349
350 ["arrow", "--"],
351
352 ["text", "[*]"],
353 ["arrow", "-->"],
354 " CapsLockOff\r\n CapsLockOff ",
355 ["arrow", "-->"],
356 " CapsLockOn ",
357 ["operator", ":"],
358 " EvCapsLockPressed\r\n CapsLockOn ",
359 ["arrow", "-->"],
360 " CapsLockOff ",
361 ["operator", ":"],
362 " EvCapsLockPressed\r\n ",
363
364 ["arrow", "--"],
365
366 ["text", "[*]"],
367 ["arrow", "-->"],
368 " ScrollLockOff\r\n ScrollLockOff ",
369 ["arrow", "-->"],
370 " ScrollLockOn ",
371 ["operator", ":"],
372 " EvScrollLockPressed\r\n ScrollLockOn ",
373 ["arrow", "-->"],
374 " ScrollLockOff ",
375 ["operator", ":"],
376 " EvScrollLockPressed\r\n ",
377
378 ["punctuation", "}"],
379
380 ["keyword", "stateDiagram"],
381
382 ["keyword", "direction"],
383 " LR\r\n ",
384
385 ["text", "[*]"],
386 ["arrow", "-->"],
387 " A\r\n A ",
388 ["arrow", "-->"],
389 " B\r\n B ",
390 ["arrow", "-->"],
391 " C\r\n ",
392
393 ["keyword", "state"],
394 " B ",
395 ["punctuation", "{"],
396
397 ["keyword", "direction"],
398 " LR\r\n a ",
399 ["arrow", "-->"],
400 " b\r\n ",
401
402 ["punctuation", "}"],
403
404 "\r\n B ",
405 ["arrow", "-->"],
406 " D\r\n\r\n",
407
408 ["keyword", "stateDiagram-v2"],
409
410 ["text", "[*]"],
411 ["arrow", "-->"],
412 " Still\r\n Still ",
413 ["arrow", "-->"],
414 ["text", "[*]"],
415
416 ["comment", "%% this is a comment"],
417
418 "\r\n Still ",
419 ["arrow", "-->"],
420 " Moving\r\n Moving ",
421 ["arrow", "-->"],
422 " Still ",
423 ["comment", "%% another comment"],
424
425 "\r\n Moving ",
426 ["arrow", "-->"],
427 " Crash\r\n Crash ",
428 ["arrow", "-->"],
429 ["text", "[*]"]
430 ]