cddl 0.13.1 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,278 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Group Choice Parsing > Blocks with Braces > should parse bare group inside brace 1`] = `
4
+ [
5
+ {
6
+ "Comments": [],
7
+ "IsChoiceAddition": false,
8
+ "Name": "myrule",
9
+ "Properties": [
10
+ {
11
+ "Comments": [],
12
+ "HasCut": false,
13
+ "Name": "",
14
+ "Occurrence": {
15
+ "m": 1,
16
+ "n": 1,
17
+ },
18
+ "Type": "int",
19
+ },
20
+ ],
21
+ "Type": "group",
22
+ },
23
+ ]
24
+ `;
25
+
26
+ exports[`Group Choice Parsing > Blocks with Braces > should parse nested group inside map 1`] = `
27
+ [
28
+ {
29
+ "Comments": [],
30
+ "IsChoiceAddition": false,
31
+ "Name": "myrule",
32
+ "Properties": [
33
+ {
34
+ "Comments": [],
35
+ "HasCut": false,
36
+ "Name": "",
37
+ "Occurrence": {
38
+ "m": 1,
39
+ "n": 1,
40
+ },
41
+ "Type": "int",
42
+ },
43
+ ],
44
+ "Type": "group",
45
+ },
46
+ ]
47
+ `;
48
+
49
+ exports[`Group Choice Parsing > Group Choice (//) > should parse group choice with multiple items 1`] = `
50
+ [
51
+ {
52
+ "Comments": [],
53
+ "IsChoiceAddition": false,
54
+ "Name": "mygroup",
55
+ "Properties": [
56
+ {
57
+ "Comments": [],
58
+ "HasCut": false,
59
+ "Name": "",
60
+ "Occurrence": {
61
+ "m": 1,
62
+ "n": 1,
63
+ },
64
+ "Type": "int",
65
+ },
66
+ [
67
+ {
68
+ "Comments": [],
69
+ "HasCut": false,
70
+ "Name": "",
71
+ "Occurrence": {
72
+ "m": 1,
73
+ "n": 1,
74
+ },
75
+ "Type": {
76
+ "Type": "group",
77
+ "Unwrapped": false,
78
+ "Value": "text",
79
+ },
80
+ },
81
+ ],
82
+ {
83
+ "Comments": [],
84
+ "HasCut": false,
85
+ "Name": "",
86
+ "Occurrence": {
87
+ "m": 1,
88
+ "n": 1,
89
+ },
90
+ "Type": "float",
91
+ },
92
+ ],
93
+ "Type": "group",
94
+ },
95
+ ]
96
+ `;
97
+
98
+ exports[`Group Choice Parsing > Group Choice (//) > should parse nested group choice 1`] = `
99
+ [
100
+ {
101
+ "Comments": [],
102
+ "IsChoiceAddition": false,
103
+ "Name": "mygroup",
104
+ "Properties": [
105
+ {
106
+ "Comments": [],
107
+ "HasCut": false,
108
+ "Name": "",
109
+ "Occurrence": {
110
+ "m": 1,
111
+ "n": 1,
112
+ },
113
+ "Type": {
114
+ "Comments": [],
115
+ "IsChoiceAddition": false,
116
+ "Name": "",
117
+ "Properties": [
118
+ [
119
+ {
120
+ "Comments": [],
121
+ "HasCut": false,
122
+ "Name": "",
123
+ "Occurrence": {
124
+ "m": 1,
125
+ "n": 1,
126
+ },
127
+ "Type": {
128
+ "Type": "group",
129
+ "Unwrapped": false,
130
+ "Value": "int",
131
+ },
132
+ },
133
+ ],
134
+ {
135
+ "Comments": [],
136
+ "HasCut": false,
137
+ "Name": "",
138
+ "Occurrence": {
139
+ "m": 1,
140
+ "n": 1,
141
+ },
142
+ "Type": "text",
143
+ },
144
+ ],
145
+ "Type": "group",
146
+ },
147
+ },
148
+ ],
149
+ "Type": "group",
150
+ },
151
+ ]
152
+ `;
153
+
154
+ exports[`Group Choice Parsing > Group Choice (//) > should verify group choice operator // 1`] = `
155
+ [
156
+ {
157
+ "Comments": [],
158
+ "IsChoiceAddition": false,
159
+ "Name": "mygroup",
160
+ "Properties": [
161
+ [
162
+ {
163
+ "Comments": [],
164
+ "HasCut": false,
165
+ "Name": "",
166
+ "Occurrence": {
167
+ "m": 1,
168
+ "n": 1,
169
+ },
170
+ "Type": {
171
+ "Type": "group",
172
+ "Unwrapped": false,
173
+ "Value": "int",
174
+ },
175
+ },
176
+ ],
177
+ {
178
+ "Comments": [],
179
+ "HasCut": false,
180
+ "Name": "",
181
+ "Occurrence": {
182
+ "m": 1,
183
+ "n": 1,
184
+ },
185
+ "Type": "text",
186
+ },
187
+ ],
188
+ "Type": "group",
189
+ },
190
+ ]
191
+ `;
192
+
193
+ exports[`Group Choice Parsing > Map Group Choice > should parse group choice inside map 1`] = `
194
+ [
195
+ {
196
+ "Comments": [],
197
+ "IsChoiceAddition": false,
198
+ "Name": "mymap",
199
+ "Properties": [
200
+ [
201
+ {
202
+ "Comments": [],
203
+ "HasCut": false,
204
+ "Name": "a",
205
+ "Occurrence": {
206
+ "m": 1,
207
+ "n": 1,
208
+ },
209
+ "Type": [
210
+ {
211
+ "Type": "literal",
212
+ "Unwrapped": false,
213
+ "Value": 1,
214
+ },
215
+ ],
216
+ },
217
+ {
218
+ "Comments": [],
219
+ "HasCut": false,
220
+ "Name": "b",
221
+ "Occurrence": {
222
+ "m": 1,
223
+ "n": 1,
224
+ },
225
+ "Type": [
226
+ {
227
+ "Type": "literal",
228
+ "Unwrapped": false,
229
+ "Value": 2,
230
+ },
231
+ ],
232
+ },
233
+ ],
234
+ ],
235
+ "Type": "group",
236
+ },
237
+ ]
238
+ `;
239
+
240
+ exports[`Group Choice Parsing > Type Choice (/) > should correctly handle slash in mixed context 1`] = `
241
+ [
242
+ {
243
+ "Comments": [],
244
+ "Name": "myrule",
245
+ "Type": "array",
246
+ "Values": [
247
+ {
248
+ "Comments": [],
249
+ "HasCut": false,
250
+ "Name": "",
251
+ "Occurrence": {
252
+ "m": 1,
253
+ "n": 1,
254
+ },
255
+ "Type": [
256
+ "int",
257
+ "text",
258
+ ],
259
+ },
260
+ ],
261
+ },
262
+ ]
263
+ `;
264
+
265
+ exports[`Group Choice Parsing > Type Choice (/) > should parse type choice inside group 1`] = `
266
+ [
267
+ {
268
+ "Comments": [],
269
+ "IsChoiceAddition": false,
270
+ "Name": "mygroup",
271
+ "PropertyType": [
272
+ "int",
273
+ "text",
274
+ ],
275
+ "Type": "variable",
276
+ },
277
+ ]
278
+ `;