@litert/typeguard 1.3.0 → 1.4.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.
- package/CHANGES.md +11 -1
- package/lib/BuiltInTypeCompiler.d.ts +1 -1
- package/lib/BuiltInTypeCompiler.js +4 -4
- package/lib/BuiltInTypeCompiler.js.map +1 -1
- package/lib/BuiltInTypes.d.ts +1 -1
- package/lib/BuiltInTypes.js +1 -1
- package/lib/Common.d.ts +6 -5
- package/lib/Common.d.ts.map +1 -1
- package/lib/Common.js +1 -1
- package/lib/Compiler.d.ts +1 -1
- package/lib/Compiler.d.ts.map +1 -1
- package/lib/Compiler.js +58 -36
- package/lib/Compiler.js.map +1 -1
- package/lib/Context.d.ts +2 -2
- package/lib/Context.d.ts.map +1 -1
- package/lib/Context.js +2 -2
- package/lib/Context.js.map +1 -1
- package/lib/FilterCompiler.d.ts +3 -3
- package/lib/FilterCompiler.d.ts.map +1 -1
- package/lib/FilterCompiler.js +4 -4
- package/lib/FilterCompiler.js.map +1 -1
- package/lib/InlineCompiler.d.ts +2 -2
- package/lib/InlineCompiler.d.ts.map +1 -1
- package/lib/InlineCompiler.js +5 -7
- package/lib/InlineCompiler.js.map +1 -1
- package/lib/Internal.d.ts +9 -4
- package/lib/Internal.d.ts.map +1 -1
- package/lib/Internal.js +45 -4
- package/lib/Internal.js.map +1 -1
- package/lib/Modifiers.d.ts +2 -1
- package/lib/Modifiers.d.ts.map +1 -1
- package/lib/Modifiers.js +3 -2
- package/lib/Modifiers.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/langs/JavaScript.d.ts +1 -1
- package/lib/langs/JavaScript.js +2 -2
- package/package.json +10 -12
- package/src/examples/quick-start.ts +5 -1
- package/src/lib/BuiltInTypeCompiler.ts +4 -4
- package/src/lib/BuiltInTypes.ts +1 -1
- package/src/lib/Common.ts +5 -4
- package/src/lib/Compiler.ts +67 -40
- package/src/lib/Context.ts +2 -2
- package/src/lib/FilterCompiler.ts +3 -3
- package/src/lib/InlineCompiler.ts +6 -9
- package/src/lib/Internal.ts +73 -4
- package/src/lib/Modifiers.ts +3 -1
- package/src/lib/index.ts +1 -1
- package/src/lib/langs/JavaScript.ts +2 -2
- package/src/test/00-all.ts +0 -35
- package/src/test/01-elemental-types.ts +0 -1963
- package/src/test/02-array-and-list.ts +0 -197
- package/src/test/03-tuple.ts +0 -220
- package/src/test/04-from-string.ts +0 -1488
- package/src/test/05-string-asserts.ts +0 -794
- package/src/test/06-structure.ts +0 -277
- package/src/test/07-modifiers.ts +0 -220
- package/src/test/08-map-and-dict.ts +0 -151
- package/src/test/09-exceptions.ts +0 -67
- package/src/test/abstracts.ts +0 -211
|
@@ -1,794 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022 Angus Fenying <fenying@litert.org>
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { createTestDefinition, defaultItemss, ITestSuite } from './abstracts';
|
|
18
|
-
|
|
19
|
-
const testItems: ITestSuite = {
|
|
20
|
-
|
|
21
|
-
name: 'String Asserts',
|
|
22
|
-
sections: [
|
|
23
|
-
{
|
|
24
|
-
'name': 'Operator ==',
|
|
25
|
-
'rule': '==aasdsadsada',
|
|
26
|
-
'items': [
|
|
27
|
-
{
|
|
28
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
29
|
-
'inputValue': 'aasdsadsada',
|
|
30
|
-
'expect': true
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
34
|
-
'inputValue': 'AASDSADSADA',
|
|
35
|
-
'expect': false
|
|
36
|
-
},
|
|
37
|
-
...defaultItemss({})
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
'name': 'Operator =',
|
|
42
|
-
'rule': '=aasdsadsada',
|
|
43
|
-
'items': [
|
|
44
|
-
{
|
|
45
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
46
|
-
'inputValue': 'aasdsadsada',
|
|
47
|
-
'expect': true
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
51
|
-
'inputValue': 'AASDSADSADA',
|
|
52
|
-
'expect': false
|
|
53
|
-
},
|
|
54
|
-
...defaultItemss({})
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
'name': 'Symbol \':equal:\'',
|
|
59
|
-
'rule': ':equal:aasdsadsada',
|
|
60
|
-
'items': [
|
|
61
|
-
{
|
|
62
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
63
|
-
'inputValue': 'aasdsadsada',
|
|
64
|
-
'expect': true
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
68
|
-
'inputValue': 'AASDSADSADA',
|
|
69
|
-
'expect': false
|
|
70
|
-
},
|
|
71
|
-
...defaultItemss({})
|
|
72
|
-
]
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
'name': 'Symbol \':equal-i:\'',
|
|
76
|
-
'rule': ':equal-i:aasdsadsada',
|
|
77
|
-
'items': [
|
|
78
|
-
{
|
|
79
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
80
|
-
'inputValue': 'aasdsadsada',
|
|
81
|
-
'expect': true
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
85
|
-
'inputValue': 'AASDSADSADA',
|
|
86
|
-
'expect': true
|
|
87
|
-
},
|
|
88
|
-
...defaultItemss({})
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
'name': 'Operator %=',
|
|
93
|
-
'rule': '%=aasdsadsada',
|
|
94
|
-
'items': [
|
|
95
|
-
{
|
|
96
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
97
|
-
'inputValue': 'aasdsadsada',
|
|
98
|
-
'expect': true
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
102
|
-
'inputValue': 'AASDSADSADA',
|
|
103
|
-
'expect': true
|
|
104
|
-
},
|
|
105
|
-
...defaultItemss({})
|
|
106
|
-
]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
'name': 'Operator !=',
|
|
110
|
-
'rule': '!=aasdsadsada',
|
|
111
|
-
'items': [
|
|
112
|
-
{
|
|
113
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
114
|
-
'inputValue': 'aasdsadsada',
|
|
115
|
-
'expect': false
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
119
|
-
'inputValue': 'AASDSADSADA',
|
|
120
|
-
'expect': true
|
|
121
|
-
},
|
|
122
|
-
...defaultItemss({
|
|
123
|
-
'string \'hello\'': true,
|
|
124
|
-
'empty string': true
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
'name': 'Symbol \':not-equal:\'',
|
|
130
|
-
'rule': ':not-equal:aasdsadsada',
|
|
131
|
-
'items': [
|
|
132
|
-
{
|
|
133
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
134
|
-
'inputValue': 'aasdsadsada',
|
|
135
|
-
'expect': false
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
139
|
-
'inputValue': 'AASDSADSADA',
|
|
140
|
-
'expect': true
|
|
141
|
-
},
|
|
142
|
-
...defaultItemss({
|
|
143
|
-
'string \'hello\'': true,
|
|
144
|
-
'empty string': true
|
|
145
|
-
})
|
|
146
|
-
]
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
'name': 'Symbol \':not-equal-i:\'',
|
|
150
|
-
'rule': ':not-equal-i:aasdsadsada',
|
|
151
|
-
'items': [
|
|
152
|
-
{
|
|
153
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
154
|
-
'inputValue': 'aasdsadsada',
|
|
155
|
-
'expect': false
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
159
|
-
'inputValue': 'AASDSADSADA',
|
|
160
|
-
'expect': false
|
|
161
|
-
},
|
|
162
|
-
...defaultItemss({
|
|
163
|
-
'string \'hello\'': true,
|
|
164
|
-
'empty string': true
|
|
165
|
-
})
|
|
166
|
-
]
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
'name': 'Operator %!',
|
|
170
|
-
'rule': '%!aasdsadsada',
|
|
171
|
-
'items': [
|
|
172
|
-
{
|
|
173
|
-
'inputName': 'string \'aasdsadsada\'',
|
|
174
|
-
'inputValue': 'aasdsadsada',
|
|
175
|
-
'expect': false
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
'inputName': 'string \'AASDSADSADA\'',
|
|
179
|
-
'inputValue': 'AASDSADSADA',
|
|
180
|
-
'expect': false
|
|
181
|
-
},
|
|
182
|
-
...defaultItemss({
|
|
183
|
-
'string \'hello\'': true,
|
|
184
|
-
'empty string': true
|
|
185
|
-
})
|
|
186
|
-
]
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
'name': 'Operator ^=',
|
|
190
|
-
'rule': '^=hello',
|
|
191
|
-
'items': [
|
|
192
|
-
{
|
|
193
|
-
'inputName': 'string \'hello world\'',
|
|
194
|
-
'inputValue': 'hello world',
|
|
195
|
-
'expect': true
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
'inputName': 'string \'hello world\'',
|
|
199
|
-
'inputValue': 'Hello world',
|
|
200
|
-
'expect': false
|
|
201
|
-
},
|
|
202
|
-
...defaultItemss({
|
|
203
|
-
'string \'hello\'': true,
|
|
204
|
-
'empty string': false
|
|
205
|
-
})
|
|
206
|
-
]
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
'name': 'Symbol \':start-with:\'',
|
|
210
|
-
'rule': ':start-with:hello',
|
|
211
|
-
'items': [
|
|
212
|
-
{
|
|
213
|
-
'inputName': 'string \'hello world\'',
|
|
214
|
-
'inputValue': 'hello world',
|
|
215
|
-
'expect': true
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
'inputName': 'string \'hello world\'',
|
|
219
|
-
'inputValue': 'Hello world',
|
|
220
|
-
'expect': false
|
|
221
|
-
},
|
|
222
|
-
...defaultItemss({
|
|
223
|
-
'string \'hello\'': true,
|
|
224
|
-
'empty string': false
|
|
225
|
-
})
|
|
226
|
-
]
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
'name': 'Symbol \':start-with-i:\'',
|
|
230
|
-
'rule': ':start-with-i:hello',
|
|
231
|
-
'items': [
|
|
232
|
-
{
|
|
233
|
-
'inputName': 'string \'hello world\'',
|
|
234
|
-
'inputValue': 'hello world',
|
|
235
|
-
'expect': true
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
'inputName': 'string \'hello world\'',
|
|
239
|
-
'inputValue': 'Hello world',
|
|
240
|
-
'expect': true
|
|
241
|
-
},
|
|
242
|
-
...defaultItemss({
|
|
243
|
-
'string \'hello\'': true,
|
|
244
|
-
'empty string': false
|
|
245
|
-
})
|
|
246
|
-
]
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
'name': 'Operator ^!',
|
|
250
|
-
'rule': '^!hello',
|
|
251
|
-
'items': [
|
|
252
|
-
{
|
|
253
|
-
'inputName': 'string \'hello world\'',
|
|
254
|
-
'inputValue': 'hello world',
|
|
255
|
-
'expect': false
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
'inputName': 'string \'hello world\'',
|
|
259
|
-
'inputValue': 'Hello world',
|
|
260
|
-
'expect': true
|
|
261
|
-
},
|
|
262
|
-
...defaultItemss({
|
|
263
|
-
'string \'hello\'': false,
|
|
264
|
-
'empty string': true
|
|
265
|
-
})
|
|
266
|
-
]
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
'name': 'Symbol \':not-start-with:\'',
|
|
270
|
-
'rule': ':not-start-with:hello',
|
|
271
|
-
'items': [
|
|
272
|
-
{
|
|
273
|
-
'inputName': 'string \'hello world\'',
|
|
274
|
-
'inputValue': 'hello world',
|
|
275
|
-
'expect': false
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
'inputName': 'string \'hello world\'',
|
|
279
|
-
'inputValue': 'Hello world',
|
|
280
|
-
'expect': true
|
|
281
|
-
},
|
|
282
|
-
...defaultItemss({
|
|
283
|
-
'string \'hello\'': false,
|
|
284
|
-
'empty string': true
|
|
285
|
-
})
|
|
286
|
-
]
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
'name': 'Symbol \':not-start-with-i:\'',
|
|
290
|
-
'rule': ':not-start-with-i:hello',
|
|
291
|
-
'items': [
|
|
292
|
-
{
|
|
293
|
-
'inputName': 'string \'hello world\'',
|
|
294
|
-
'inputValue': 'hello world',
|
|
295
|
-
'expect': false
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
'inputName': 'string \'hello world\'',
|
|
299
|
-
'inputValue': 'Hello world',
|
|
300
|
-
'expect': false
|
|
301
|
-
},
|
|
302
|
-
...defaultItemss({
|
|
303
|
-
'string \'hello\'': false,
|
|
304
|
-
'empty string': true
|
|
305
|
-
})
|
|
306
|
-
]
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
'name': 'Operator $=',
|
|
310
|
-
'rule': '$=world',
|
|
311
|
-
'items': [
|
|
312
|
-
{
|
|
313
|
-
'inputName': 'string \'hello world\'',
|
|
314
|
-
'inputValue': 'hello world',
|
|
315
|
-
'expect': true
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
'inputName': 'string \'hello world\'',
|
|
319
|
-
'inputValue': 'Hello World',
|
|
320
|
-
'expect': false
|
|
321
|
-
},
|
|
322
|
-
...defaultItemss({
|
|
323
|
-
'string \'hello\'': false,
|
|
324
|
-
'empty string': false
|
|
325
|
-
})
|
|
326
|
-
]
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
'name': 'Symbol \':end-with:\'',
|
|
330
|
-
'rule': ':end-with:world',
|
|
331
|
-
'items': [
|
|
332
|
-
{
|
|
333
|
-
'inputName': 'string \'hello world\'',
|
|
334
|
-
'inputValue': 'hello world',
|
|
335
|
-
'expect': true
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
'inputName': 'string \'hello world\'',
|
|
339
|
-
'inputValue': 'Hello World',
|
|
340
|
-
'expect': false
|
|
341
|
-
},
|
|
342
|
-
...defaultItemss({
|
|
343
|
-
'string \'hello\'': false,
|
|
344
|
-
'empty string': false
|
|
345
|
-
})
|
|
346
|
-
]
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
'name': 'Symbol \':end-with-i:\'',
|
|
350
|
-
'rule': ':end-with-i:world',
|
|
351
|
-
'items': [
|
|
352
|
-
{
|
|
353
|
-
'inputName': 'string \'hello world\'',
|
|
354
|
-
'inputValue': 'hello world',
|
|
355
|
-
'expect': true
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
'inputName': 'string \'hello world\'',
|
|
359
|
-
'inputValue': 'Hello World',
|
|
360
|
-
'expect': true
|
|
361
|
-
},
|
|
362
|
-
...defaultItemss({
|
|
363
|
-
'string \'hello\'': false,
|
|
364
|
-
'empty string': false
|
|
365
|
-
})
|
|
366
|
-
]
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
'name': 'Operator $!',
|
|
370
|
-
'rule': '$!world',
|
|
371
|
-
'items': [
|
|
372
|
-
{
|
|
373
|
-
'inputName': 'string \'hello world\'',
|
|
374
|
-
'inputValue': 'hello world',
|
|
375
|
-
'expect': false
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
'inputName': 'string \'hello world\'',
|
|
379
|
-
'inputValue': 'Hello World',
|
|
380
|
-
'expect': true
|
|
381
|
-
},
|
|
382
|
-
...defaultItemss({
|
|
383
|
-
'string \'hello\'': true,
|
|
384
|
-
'empty string': true
|
|
385
|
-
})
|
|
386
|
-
]
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
'name': 'Symbol \':not-end-with:\'',
|
|
390
|
-
'rule': ':not-end-with:world',
|
|
391
|
-
'items': [
|
|
392
|
-
{
|
|
393
|
-
'inputName': 'string \'hello world\'',
|
|
394
|
-
'inputValue': 'hello world',
|
|
395
|
-
'expect': false
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
'inputName': 'string \'hello world\'',
|
|
399
|
-
'inputValue': 'Hello World',
|
|
400
|
-
'expect': true
|
|
401
|
-
},
|
|
402
|
-
...defaultItemss({
|
|
403
|
-
'string \'hello\'': true,
|
|
404
|
-
'empty string': true
|
|
405
|
-
})
|
|
406
|
-
]
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
'name': 'Symbol \':not-end-with-i:\'',
|
|
410
|
-
'rule': ':not-end-with-i:world',
|
|
411
|
-
'items': [
|
|
412
|
-
{
|
|
413
|
-
'inputName': 'string \'hello world\'',
|
|
414
|
-
'inputValue': 'hello World',
|
|
415
|
-
'expect': false
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
'inputName': 'string \'hello world\'',
|
|
419
|
-
'inputValue': 'Hello world',
|
|
420
|
-
'expect': false
|
|
421
|
-
},
|
|
422
|
-
...defaultItemss({
|
|
423
|
-
'string \'hello\'': true,
|
|
424
|
-
'empty string': true
|
|
425
|
-
})
|
|
426
|
-
]
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Include
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
|
-
{
|
|
434
|
-
'name': 'Operator ?=',
|
|
435
|
-
'rule': '?=hello',
|
|
436
|
-
'items': [
|
|
437
|
-
{
|
|
438
|
-
'inputName': 'string \'hello world\'',
|
|
439
|
-
'inputValue': 'hello world',
|
|
440
|
-
'expect': true
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
'inputName': 'string \'hello world\'',
|
|
444
|
-
'inputValue': 'Hello world',
|
|
445
|
-
'expect': false
|
|
446
|
-
},
|
|
447
|
-
...defaultItemss({
|
|
448
|
-
'string \'hello\'': true,
|
|
449
|
-
'empty string': false
|
|
450
|
-
})
|
|
451
|
-
]
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
'name': 'Symbol \':include:\'',
|
|
455
|
-
'rule': ':include:hello',
|
|
456
|
-
'items': [
|
|
457
|
-
{
|
|
458
|
-
'inputName': 'string \'hello world\'',
|
|
459
|
-
'inputValue': 'hello world',
|
|
460
|
-
'expect': true
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
'inputName': 'string \'hello world\'',
|
|
464
|
-
'inputValue': 'Hello world',
|
|
465
|
-
'expect': false
|
|
466
|
-
},
|
|
467
|
-
...defaultItemss({
|
|
468
|
-
'string \'hello\'': true,
|
|
469
|
-
'empty string': false
|
|
470
|
-
})
|
|
471
|
-
]
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
'name': 'Operator *=',
|
|
475
|
-
'rule': '*=hello',
|
|
476
|
-
'items': [
|
|
477
|
-
{
|
|
478
|
-
'inputName': 'string \'hello world\'',
|
|
479
|
-
'inputValue': 'hello world',
|
|
480
|
-
'expect': true
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
'inputName': 'string \'hello world\'',
|
|
484
|
-
'inputValue': 'Hello world',
|
|
485
|
-
'expect': true
|
|
486
|
-
},
|
|
487
|
-
...defaultItemss({
|
|
488
|
-
'string \'hello\'': true,
|
|
489
|
-
'empty string': false
|
|
490
|
-
})
|
|
491
|
-
]
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
'name': 'Symbol \':include-i:\'',
|
|
495
|
-
'rule': ':include-i:hello',
|
|
496
|
-
'items': [
|
|
497
|
-
{
|
|
498
|
-
'inputName': 'string \'hello world\'',
|
|
499
|
-
'inputValue': 'hello world',
|
|
500
|
-
'expect': true
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
'inputName': 'string \'hello world\'',
|
|
504
|
-
'inputValue': 'Hello world',
|
|
505
|
-
'expect': true
|
|
506
|
-
},
|
|
507
|
-
...defaultItemss({
|
|
508
|
-
'string \'hello\'': true,
|
|
509
|
-
'empty string': false
|
|
510
|
-
})
|
|
511
|
-
]
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
'name': 'Operator ?!',
|
|
515
|
-
'rule': '?!hello',
|
|
516
|
-
'items': [
|
|
517
|
-
{
|
|
518
|
-
'inputName': 'string \'hello world\'',
|
|
519
|
-
'inputValue': 'hello world',
|
|
520
|
-
'expect': false
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
'inputName': 'string \'hello world\'',
|
|
524
|
-
'inputValue': 'Hello world',
|
|
525
|
-
'expect': true
|
|
526
|
-
},
|
|
527
|
-
...defaultItemss({
|
|
528
|
-
'string \'hello\'': false,
|
|
529
|
-
'empty string': true
|
|
530
|
-
})
|
|
531
|
-
]
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
'name': 'Symbol \':not-include:\'',
|
|
535
|
-
'rule': ':not-include:hello',
|
|
536
|
-
'items': [
|
|
537
|
-
{
|
|
538
|
-
'inputName': 'string \'hello world\'',
|
|
539
|
-
'inputValue': 'hello world',
|
|
540
|
-
'expect': false
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
'inputName': 'string \'hello world\'',
|
|
544
|
-
'inputValue': 'Hello world',
|
|
545
|
-
'expect': true
|
|
546
|
-
},
|
|
547
|
-
...defaultItemss({
|
|
548
|
-
'string \'hello\'': false,
|
|
549
|
-
'empty string': true
|
|
550
|
-
})
|
|
551
|
-
]
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
'name': 'Symbol \':not-include-i:\'',
|
|
555
|
-
'rule': ':not-include-i:hello',
|
|
556
|
-
'items': [
|
|
557
|
-
{
|
|
558
|
-
'inputName': 'string \'hello world\'',
|
|
559
|
-
'inputValue': 'hello world',
|
|
560
|
-
'expect': false
|
|
561
|
-
},
|
|
562
|
-
{
|
|
563
|
-
'inputName': 'string \'hello world\'',
|
|
564
|
-
'inputValue': 'Hello world',
|
|
565
|
-
'expect': false
|
|
566
|
-
},
|
|
567
|
-
...defaultItemss({
|
|
568
|
-
'string \'hello\'': false,
|
|
569
|
-
'empty string': true
|
|
570
|
-
})
|
|
571
|
-
]
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
'name': 'Operator *!',
|
|
575
|
-
'rule': '*!hello',
|
|
576
|
-
'items': [
|
|
577
|
-
{
|
|
578
|
-
'inputName': 'string \'hello world\'',
|
|
579
|
-
'inputValue': 'hello world',
|
|
580
|
-
'expect': false
|
|
581
|
-
},
|
|
582
|
-
{
|
|
583
|
-
'inputName': 'string \'hello world\'',
|
|
584
|
-
'inputValue': 'Hello world',
|
|
585
|
-
'expect': false
|
|
586
|
-
},
|
|
587
|
-
...defaultItemss({
|
|
588
|
-
'string \'hello\'': false,
|
|
589
|
-
'empty string': true
|
|
590
|
-
})
|
|
591
|
-
]
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
'name': 'Operator ~=/hello/i',
|
|
595
|
-
'rule': '~=/hello/i',
|
|
596
|
-
'items': [
|
|
597
|
-
{
|
|
598
|
-
'inputName': 'string \'hello world\'',
|
|
599
|
-
'inputValue': 'hello world',
|
|
600
|
-
'expect': true
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
'inputName': 'string \'hello world\'',
|
|
604
|
-
'inputValue': 'Hello world',
|
|
605
|
-
'expect': true
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
'inputName': 'string \'hi world\'',
|
|
609
|
-
'inputValue': 'hi world',
|
|
610
|
-
'expect': false
|
|
611
|
-
},
|
|
612
|
-
...defaultItemss({
|
|
613
|
-
'string \'hello\'': true,
|
|
614
|
-
'empty string': false
|
|
615
|
-
})
|
|
616
|
-
]
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
'name': 'Operator ~=hello',
|
|
620
|
-
'rule': '~=hello',
|
|
621
|
-
'items': [
|
|
622
|
-
{
|
|
623
|
-
'inputName': 'string \'hello world\'',
|
|
624
|
-
'inputValue': 'hello world',
|
|
625
|
-
'expect': true
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
'inputName': 'string \'hello world\'',
|
|
629
|
-
'inputValue': 'Hello world',
|
|
630
|
-
'expect': false
|
|
631
|
-
},
|
|
632
|
-
{
|
|
633
|
-
'inputName': 'string \'hi world\'',
|
|
634
|
-
'inputValue': 'hi world',
|
|
635
|
-
'expect': false
|
|
636
|
-
},
|
|
637
|
-
...defaultItemss({
|
|
638
|
-
'string \'hello\'': true,
|
|
639
|
-
'empty string': false
|
|
640
|
-
})
|
|
641
|
-
]
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
'name': 'Operator ~/hello/i',
|
|
645
|
-
'rule': '~/hello/i',
|
|
646
|
-
'items': [
|
|
647
|
-
{
|
|
648
|
-
'inputName': 'string \'hello world\'',
|
|
649
|
-
'inputValue': 'hello world',
|
|
650
|
-
'expect': true
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
'inputName': 'string \'hello world\'',
|
|
654
|
-
'inputValue': 'Hello world',
|
|
655
|
-
'expect': true
|
|
656
|
-
},
|
|
657
|
-
{
|
|
658
|
-
'inputName': 'string \'hi world\'',
|
|
659
|
-
'inputValue': 'hi world',
|
|
660
|
-
'expect': false
|
|
661
|
-
},
|
|
662
|
-
...defaultItemss({
|
|
663
|
-
'string \'hello\'': true,
|
|
664
|
-
'empty string': false
|
|
665
|
-
})
|
|
666
|
-
]
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
'name': 'Operator ~hello',
|
|
670
|
-
'rule': '~hello',
|
|
671
|
-
'items': [
|
|
672
|
-
{
|
|
673
|
-
'inputName': 'string \'hello world\'',
|
|
674
|
-
'inputValue': 'hello world',
|
|
675
|
-
'expect': true
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
'inputName': 'string \'hello world\'',
|
|
679
|
-
'inputValue': 'Hello world',
|
|
680
|
-
'expect': false
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
'inputName': 'string \'hi world\'',
|
|
684
|
-
'inputValue': 'hi world',
|
|
685
|
-
'expect': false
|
|
686
|
-
},
|
|
687
|
-
...defaultItemss({
|
|
688
|
-
'string \'hello\'': true,
|
|
689
|
-
'empty string': false
|
|
690
|
-
})
|
|
691
|
-
]
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
'name': 'Operator ~!hello',
|
|
695
|
-
'rule': '~!hello',
|
|
696
|
-
'items': [
|
|
697
|
-
{
|
|
698
|
-
'inputName': 'string \'hello world\'',
|
|
699
|
-
'inputValue': 'hello world',
|
|
700
|
-
'expect': false
|
|
701
|
-
},
|
|
702
|
-
{
|
|
703
|
-
'inputName': 'string \'hello world\'',
|
|
704
|
-
'inputValue': 'Hello world',
|
|
705
|
-
'expect': true
|
|
706
|
-
},
|
|
707
|
-
{
|
|
708
|
-
'inputName': 'string \'hi world\'',
|
|
709
|
-
'inputValue': 'hi world',
|
|
710
|
-
'expect': true
|
|
711
|
-
},
|
|
712
|
-
...defaultItemss({
|
|
713
|
-
'string \'hello\'': false,
|
|
714
|
-
'empty string': true
|
|
715
|
-
})
|
|
716
|
-
]
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
'name': 'Operator ~!/hello/i',
|
|
720
|
-
'rule': '~!/hello/i',
|
|
721
|
-
'items': [
|
|
722
|
-
{
|
|
723
|
-
'inputName': 'string \'hello world\'',
|
|
724
|
-
'inputValue': 'hello world',
|
|
725
|
-
'expect': false
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
'inputName': 'string \'hello world\'',
|
|
729
|
-
'inputValue': 'Hello world',
|
|
730
|
-
'expect': false
|
|
731
|
-
},
|
|
732
|
-
{
|
|
733
|
-
'inputName': 'string \'hi world\'',
|
|
734
|
-
'inputValue': 'hi world',
|
|
735
|
-
'expect': true
|
|
736
|
-
},
|
|
737
|
-
...defaultItemss({
|
|
738
|
-
'string \'hello\'': false,
|
|
739
|
-
'empty string': true
|
|
740
|
-
})
|
|
741
|
-
]
|
|
742
|
-
},
|
|
743
|
-
{
|
|
744
|
-
'name': 'Operator ~!/hello/i with negative assert shortcut',
|
|
745
|
-
'rule': '!~!/hello/i',
|
|
746
|
-
'items': [
|
|
747
|
-
{
|
|
748
|
-
'inputName': 'string \'hello world\'',
|
|
749
|
-
'inputValue': 'hello world',
|
|
750
|
-
'expect': true
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
'inputName': 'string \'hello world\'',
|
|
754
|
-
'inputValue': 'Hello world',
|
|
755
|
-
'expect': true
|
|
756
|
-
},
|
|
757
|
-
{
|
|
758
|
-
'inputName': 'string \'hi world\'',
|
|
759
|
-
'inputValue': 'hi world',
|
|
760
|
-
'expect': false
|
|
761
|
-
},
|
|
762
|
-
...defaultItemss({
|
|
763
|
-
'empty string': false
|
|
764
|
-
}, true)
|
|
765
|
-
]
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
'name': 'Operator ~!/hello/i with negative assert',
|
|
769
|
-
'rule': ['$.not', '~!/hello/i'],
|
|
770
|
-
'items': [
|
|
771
|
-
{
|
|
772
|
-
'inputName': 'string \'hello world\'',
|
|
773
|
-
'inputValue': 'hello world',
|
|
774
|
-
'expect': true
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
'inputName': 'string \'hello world\'',
|
|
778
|
-
'inputValue': 'Hello world',
|
|
779
|
-
'expect': true
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
'inputName': 'string \'hi world\'',
|
|
783
|
-
'inputValue': 'hi world',
|
|
784
|
-
'expect': false
|
|
785
|
-
},
|
|
786
|
-
...defaultItemss({
|
|
787
|
-
'empty string': false
|
|
788
|
-
}, true)
|
|
789
|
-
]
|
|
790
|
-
},
|
|
791
|
-
]
|
|
792
|
-
};
|
|
793
|
-
|
|
794
|
-
export default createTestDefinition(testItems);
|