Debian Codegraph @

internal/libyaml/testdata/options.yaml

raw symbols SCIP
1 # Tests for options.go
2 # Testing Option functions, ApplyOptions, and CombineOptions
3
4 # WithIndent tests
5 - name: WithIndent with valid value 2
6 type: with-indent
7 from: 2
8 want:
9 indent: 2
10
11 - name: WithIndent with valid value 4
12 type: with-indent
13 from: 4
14 want:
15 indent: 4
16
17 - name: WithIndent with valid value 9
18 type: with-indent
19 from: 9
20 want:
21 indent: 9
22
23 - name: WithIndent with invalid value 1
24 type: with-indent
25 from: 1
26 like: "indent must be between 2 and 9"
27
28 - name: WithIndent with invalid value 10
29 type: with-indent
30 from: 10
31 like: "indent must be between 2 and 9"
32
33 - name: WithIndent with invalid value 0
34 type: with-indent
35 from: 0
36 like: "indent must be between 2 and 9"
37
38 # WithCompactSeqIndent tests
39 - name: WithCompactSeqIndent with no args (default true)
40 type: with-compact-seq-indent
41 from: []
42 want:
43 compact_seq_indent: true
44
45 - name: WithCompactSeqIndent with true
46 type: with-compact-seq-indent
47 from: [true]
48 want:
49 compact_seq_indent: true
50
51 - name: WithCompactSeqIndent with false
52 type: with-compact-seq-indent
53 from: [false]
54 want:
55 compact_seq_indent: false
56
57 - name: WithCompactSeqIndent with too many args
58 type: with-compact-seq-indent
59 from: [true, false]
60 like: "accepts at most one argument"
61
62 # WithKnownFields tests
63 - name: WithKnownFields with no args (default true)
64 type: with-known-fields
65 from: []
66 want:
67 known_fields: true
68
69 - name: WithKnownFields with true
70 type: with-known-fields
71 from: [true]
72 want:
73 known_fields: true
74
75 - name: WithKnownFields with false
76 type: with-known-fields
77 from: [false]
78 want:
79 known_fields: false
80
81 - name: WithKnownFields with too many args
82 type: with-known-fields
83 from: [true, false]
84 like: "accepts at most one argument"
85
86 # WithSingleDocument tests
87 - name: WithSingleDocument with no args (default true)
88 type: with-single-document
89 from: []
90 want:
91 single_document: true
92
93 - name: WithSingleDocument with true
94 type: with-single-document
95 from: [true]
96 want:
97 single_document: true
98
99 - name: WithSingleDocument with false
100 type: with-single-document
101 from: [false]
102 want:
103 single_document: false
104
105 - name: WithSingleDocument with too many args
106 type: with-single-document
107 from: [true, false]
108 like: "accepts at most one argument"
109
110 # WithStreamNodes tests
111 - name: WithStreamNodes with no args (default true)
112 type: with-stream-nodes
113 from: []
114 want:
115 stream_nodes: true
116
117 - name: WithStreamNodes with true
118 type: with-stream-nodes
119 from: [true]
120 want:
121 stream_nodes: true
122
123 - name: WithStreamNodes with false
124 type: with-stream-nodes
125 from: [false]
126 want:
127 stream_nodes: false
128
129 - name: WithStreamNodes with too many args
130 type: with-stream-nodes
131 from: [true, false]
132 like: "accepts at most one argument"
133
134 # WithAllDocuments tests
135 - name: WithAllDocuments with no args (default true)
136 type: with-all-documents
137 from: []
138 want:
139 all_documents: true
140
141 - name: WithAllDocuments with true
142 type: with-all-documents
143 from: [true]
144 want:
145 all_documents: true
146
147 - name: WithAllDocuments with false
148 type: with-all-documents
149 from: [false]
150 want:
151 all_documents: false
152
153 - name: WithAllDocuments with too many args
154 type: with-all-documents
155 from: [true, false]
156 like: "accepts at most one argument"
157
158 # WithLineWidth tests
159 - name: WithLineWidth with positive value
160 type: with-line-width
161 from: 100
162 want:
163 line_width: 100
164
165 - name: WithLineWidth with zero
166 type: with-line-width
167 from: 0
168 want:
169 line_width: 0
170
171 - name: WithLineWidth with negative (unlimited)
172 type: with-line-width
173 from: -5
174 want:
175 line_width: -1
176
177 # WithUnicode tests
178 - name: WithUnicode with no args (default true)
179 type: with-unicode
180 from: []
181 want:
182 unicode: true
183
184 - name: WithUnicode with true
185 type: with-unicode
186 from: [true]
187 want:
188 unicode: true
189
190 - name: WithUnicode with false
191 type: with-unicode
192 from: [false]
193 want:
194 unicode: false
195
196 - name: WithUnicode with too many args
197 type: with-unicode
198 from: [true, false]
199 like: "accepts at most one argument"
200
201 # WithUniqueKeys tests
202 - name: WithUniqueKeys with no args (default true)
203 type: with-unique-keys
204 from: []
205 want:
206 unique_keys: true
207
208 - name: WithUniqueKeys with true
209 type: with-unique-keys
210 from: [true]
211 want:
212 unique_keys: true
213
214 - name: WithUniqueKeys with false
215 type: with-unique-keys
216 from: [false]
217 want:
218 unique_keys: false
219
220 - name: WithUniqueKeys with too many args
221 type: with-unique-keys
222 from: [true, false]
223 like: "accepts at most one argument"
224
225 # WithCanonical tests
226 - name: WithCanonical with no args (default true)
227 type: with-canonical
228 from: []
229 want:
230 canonical: true
231
232 - name: WithCanonical with true
233 type: with-canonical
234 from: [true]
235 want:
236 canonical: true
237
238 - name: WithCanonical with false
239 type: with-canonical
240 from: [false]
241 want:
242 canonical: false
243
244 - name: WithCanonical with too many args
245 type: with-canonical
246 from: [true, false]
247 like: "accepts at most one argument"
248
249 # WithLineBreak tests
250 - name: WithLineBreak with LN
251 type: with-line-break
252 from: LN_BREAK
253 want:
254 line_break: LN_BREAK
255
256 - name: WithLineBreak with CR
257 type: with-line-break
258 from: CR_BREAK
259 want:
260 line_break: CR_BREAK
261
262 - name: WithLineBreak with CRLN
263 type: with-line-break
264 from: CRLN_BREAK
265 want:
266 line_break: CRLN_BREAK
267
268 # WithExplicitStart tests
269 - name: WithExplicitStart with no args (default true)
270 type: with-explicit-start
271 from: []
272 want:
273 explicit_start: true
274
275 - name: WithExplicitStart with true
276 type: with-explicit-start
277 from: [true]
278 want:
279 explicit_start: true
280
281 - name: WithExplicitStart with false
282 type: with-explicit-start
283 from: [false]
284 want:
285 explicit_start: false
286
287 - name: WithExplicitStart with too many args
288 type: with-explicit-start
289 from: [true, false]
290 like: "accepts at most one argument"
291
292 # WithExplicitEnd tests
293 - name: WithExplicitEnd with no args (default true)
294 type: with-explicit-end
295 from: []
296 want:
297 explicit_end: true
298
299 - name: WithExplicitEnd with true
300 type: with-explicit-end
301 from: [true]
302 want:
303 explicit_end: true
304
305 - name: WithExplicitEnd with false
306 type: with-explicit-end
307 from: [false]
308 want:
309 explicit_end: false
310
311 - name: WithExplicitEnd with too many args
312 type: with-explicit-end
313 from: [true, false]
314 like: "accepts at most one argument"
315
316 # WithFlowSimpleCollections tests
317 - name: WithFlowSimpleCollections with no args (default true)
318 type: with-flow-simple-collections
319 from: []
320 want:
321 flow_simple_collections: true
322
323 - name: WithFlowSimpleCollections with true
324 type: with-flow-simple-collections
325 from: [true]
326 want:
327 flow_simple_collections: true
328
329 - name: WithFlowSimpleCollections with false
330 type: with-flow-simple-collections
331 from: [false]
332 want:
333 flow_simple_collections: false
334
335 - name: WithFlowSimpleCollections with too many args
336 type: with-flow-simple-collections
337 from: [true, false]
338 like: "accepts at most one argument"
339
340 # WithQuotePreference tests
341 - name: WithQuotePreference with QuoteSingle
342 type: with-quote-preference
343 from: QuoteSingle
344 want:
345 quote_preference: QuoteSingle
346
347 - name: WithQuotePreference with QuoteDouble
348 type: with-quote-preference
349 from: QuoteDouble
350 want:
351 quote_preference: QuoteDouble
352
353 - name: WithQuotePreference with QuoteLegacy
354 type: with-quote-preference
355 from: QuoteLegacy
356 want:
357 quote_preference: QuoteLegacy
358
359 - name: WithQuotePreference with invalid value
360 type: with-quote-preference
361 from: 99
362 like: "invalid QuoteStyle value"
363
364 # ApplyOptions tests
365 - name: ApplyOptions with no options (v4 defaults)
366 type: apply-options
367 want:
368 indent: 2
369 compact_seq_indent: true
370 line_width: 80
371 unicode: true
372 unique_keys: true
373 canonical: false