@litert/typeguard 1.0.1 → 1.3.0-dev.0
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 +16 -0
- package/lib/BuiltInTypeCompiler.d.ts +4 -4
- package/lib/BuiltInTypeCompiler.d.ts.map +1 -1
- package/lib/BuiltInTypeCompiler.js +167 -166
- package/lib/BuiltInTypeCompiler.js.map +1 -1
- package/lib/BuiltInTypes.d.ts +1 -1
- package/lib/BuiltInTypes.js +37 -36
- package/lib/BuiltInTypes.js.map +1 -1
- package/lib/Common.d.ts +27 -10
- package/lib/Common.d.ts.map +1 -1
- package/lib/Common.js +1 -1
- package/lib/Compiler.d.ts +2 -2
- package/lib/Compiler.d.ts.map +1 -1
- package/lib/Compiler.js +159 -102
- package/lib/Compiler.js.map +1 -1
- package/lib/Context.d.ts +6 -5
- package/lib/Context.d.ts.map +1 -1
- package/lib/Context.js +11 -7
- package/lib/Context.js.map +1 -1
- package/lib/FilterCompiler.d.ts +5 -5
- package/lib/FilterCompiler.d.ts.map +1 -1
- package/lib/FilterCompiler.js +25 -24
- package/lib/FilterCompiler.js.map +1 -1
- package/lib/InlineCompiler.d.ts +12 -5
- package/lib/InlineCompiler.d.ts.map +1 -1
- package/lib/InlineCompiler.js +18 -6
- package/lib/InlineCompiler.js.map +1 -1
- package/lib/Internal.d.ts +6 -4
- package/lib/Internal.d.ts.map +1 -1
- package/lib/Internal.js +12 -10
- package/lib/Internal.js.map +1 -1
- package/lib/Modifiers.d.ts +1 -1
- package/lib/Modifiers.js +2 -1
- package/lib/Modifiers.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +19 -7
- package/lib/index.js.map +1 -1
- package/lib/langs/JavaScript.d.ts +2 -2
- package/lib/langs/JavaScript.d.ts.map +1 -1
- package/lib/langs/JavaScript.js +55 -29
- package/lib/langs/JavaScript.js.map +1 -1
- package/package.json +17 -13
- package/src/examples/quick-start.ts +172 -0
- package/src/lib/BuiltInTypeCompiler.ts +171 -171
- package/src/lib/BuiltInTypes.ts +36 -36
- package/src/lib/Common.ts +49 -10
- package/src/lib/Compiler.ts +354 -247
- package/src/lib/Context.ts +11 -13
- package/src/lib/FilterCompiler.ts +84 -84
- package/src/lib/InlineCompiler.ts +41 -15
- package/src/lib/Internal.ts +17 -13
- package/src/lib/Modifiers.ts +2 -2
- package/src/lib/index.ts +5 -5
- package/src/lib/langs/JavaScript.ts +84 -31
- package/src/test/00-all.ts +10 -10
- package/src/test/01-elemental-types.ts +1111 -1110
- package/src/test/02-array-and-list.ts +75 -75
- package/src/test/03-tuple.ts +87 -87
- package/src/test/04-from-string.ts +849 -848
- package/src/test/05-string-asserts.ts +422 -422
- package/src/test/06-structure.ts +107 -107
- package/src/test/07-modifiers.ts +151 -42
- package/src/test/08-map-and-dict.ts +46 -46
- package/src/test/09-exceptions.ts +30 -9
- package/src/test/abstracts.ts +83 -45
- package/dist/typeguard.amd.d.ts +0 -588
- package/dist/typeguard.amd.d.ts.map +0 -1
- package/dist/typeguard.amd.js +0 -2069
- package/dist/typeguard.amd.js.map +0 -1
- package/dist/typeguard.system.d.ts +0 -588
- package/dist/typeguard.system.d.ts.map +0 -1
- package/dist/typeguard.system.js +0 -2185
- package/dist/typeguard.system.js.map +0 -1
- package/src/samples/quick-start.ts +0 -52
- package/tsconfig-amd.json +0 -72
- package/tsconfig-systemjs.json +0 -72
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-loss-of-precision */
|
|
1
2
|
/**
|
|
2
|
-
* Copyright
|
|
3
|
+
* Copyright 2022 Angus Fenying <fenying@litert.org>
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -14,1470 +15,1470 @@
|
|
|
14
15
|
* limitations under the License.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
import { createTestDefinition, defaultItemss, ITestSuite } from
|
|
18
|
+
import { createTestDefinition, defaultItemss, ITestSuite } from './abstracts';
|
|
18
19
|
|
|
19
20
|
const testItems: ITestSuite = {
|
|
20
21
|
|
|
21
|
-
name:
|
|
22
|
+
name: 'From String',
|
|
22
23
|
sections: [
|
|
23
24
|
|
|
24
25
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
'name': 'Boolean',
|
|
27
|
+
'rule': ['$.string', 'boolean'],
|
|
28
|
+
'items': [
|
|
28
29
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
'inputName': 'string \'true\'',
|
|
31
|
+
'inputValue': 'true',
|
|
32
|
+
'expect': true
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
'inputName': 'string \'false\'',
|
|
36
|
+
'inputValue': 'false',
|
|
37
|
+
'expect': true
|
|
37
38
|
},
|
|
38
39
|
...defaultItemss({
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
'true': true,
|
|
41
|
+
'false': true
|
|
41
42
|
})
|
|
42
43
|
]
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
'name': 'True',
|
|
47
|
+
'rule': ['$.string', 'true'],
|
|
48
|
+
'items': [
|
|
48
49
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
'inputName': 'string \'true\'',
|
|
51
|
+
'inputValue': 'true',
|
|
52
|
+
'expect': true
|
|
52
53
|
},
|
|
53
54
|
...defaultItemss({
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
'true': true,
|
|
56
|
+
'false': false
|
|
56
57
|
})
|
|
57
58
|
]
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
'name': 'False',
|
|
62
|
+
'rule': ['$.string', 'false'],
|
|
63
|
+
'items': [
|
|
63
64
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
'inputName': 'string \'false\'',
|
|
66
|
+
'inputValue': 'false',
|
|
67
|
+
'expect': true
|
|
67
68
|
},
|
|
68
69
|
...defaultItemss({
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
'true': false,
|
|
71
|
+
'false': true
|
|
71
72
|
})
|
|
72
73
|
]
|
|
73
74
|
},
|
|
74
75
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
'name': 'Integer',
|
|
77
|
+
'rule': ['$.string', 'int'],
|
|
78
|
+
'items': [
|
|
78
79
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
'inputName': 'number -1',
|
|
81
|
+
'inputValue': -1,
|
|
82
|
+
'expect': true
|
|
82
83
|
},
|
|
83
84
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
'inputName': 'string \'-1\'',
|
|
86
|
+
'inputValue': '-1',
|
|
87
|
+
'expect': true
|
|
87
88
|
},
|
|
88
89
|
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
'inputName': 'string \'1.23\'',
|
|
91
|
+
'inputValue': '1.23',
|
|
92
|
+
'expect': false
|
|
92
93
|
},
|
|
93
94
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
'inputName': 'number 1.23',
|
|
96
|
+
'inputValue': 1.23,
|
|
97
|
+
'expect': false
|
|
97
98
|
},
|
|
98
99
|
...defaultItemss({
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
'number 0': true,
|
|
101
|
+
'number 1': true
|
|
101
102
|
})
|
|
102
103
|
]
|
|
103
104
|
},
|
|
104
105
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
'name': 'Integer >= 10',
|
|
107
|
+
'rule': ['$.string', 'int(10,)'],
|
|
108
|
+
'items': [
|
|
108
109
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
'inputName': 'number 11',
|
|
111
|
+
'inputValue': 11,
|
|
112
|
+
'expect': true
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
'inputName': 'number 10',
|
|
116
|
+
'inputValue': 10,
|
|
117
|
+
'expect': true
|
|
117
118
|
},
|
|
118
119
|
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
'inputName': 'number -1',
|
|
121
|
+
'inputValue': -1,
|
|
122
|
+
'expect': false
|
|
122
123
|
},
|
|
123
124
|
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
'inputName': 'number 9',
|
|
126
|
+
'inputValue': 9,
|
|
127
|
+
'expect': false
|
|
127
128
|
},
|
|
128
129
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
'inputName': 'number 1.23',
|
|
131
|
+
'inputValue': 1.23,
|
|
132
|
+
'expect': false
|
|
132
133
|
},
|
|
133
134
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
'inputName': 'string \'11\'',
|
|
136
|
+
'inputValue': '11',
|
|
137
|
+
'expect': true
|
|
137
138
|
},
|
|
138
139
|
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
'inputName': 'string \'10\'',
|
|
141
|
+
'inputValue': '10',
|
|
142
|
+
'expect': true
|
|
142
143
|
},
|
|
143
144
|
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
'inputName': 'string \'-1\'',
|
|
146
|
+
'inputValue': '-1',
|
|
147
|
+
'expect': false
|
|
147
148
|
},
|
|
148
149
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
'inputName': 'string \'9\'',
|
|
151
|
+
'inputValue': '9',
|
|
152
|
+
'expect': false
|
|
152
153
|
},
|
|
153
154
|
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
'inputName': 'string \'1.23\'',
|
|
156
|
+
'inputValue': '1.23',
|
|
157
|
+
'expect': false
|
|
157
158
|
},
|
|
158
159
|
...defaultItemss({
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
'number 0': false,
|
|
161
|
+
'number 1': false
|
|
161
162
|
})
|
|
162
163
|
]
|
|
163
164
|
},
|
|
164
165
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
'name': 'Integer <= 10',
|
|
167
|
+
'rule': ['$.string', 'int(,10)'],
|
|
168
|
+
'items': [
|
|
168
169
|
{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
'inputName': 'number 11',
|
|
171
|
+
'inputValue': 11,
|
|
172
|
+
'expect': false
|
|
172
173
|
},
|
|
173
174
|
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
'inputName': 'number 10',
|
|
176
|
+
'inputValue': 10,
|
|
177
|
+
'expect': true
|
|
177
178
|
},
|
|
178
179
|
{
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
'inputName': 'number -1',
|
|
181
|
+
'inputValue': -1,
|
|
182
|
+
'expect': true
|
|
182
183
|
},
|
|
183
184
|
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
'inputName': 'number 9',
|
|
186
|
+
'inputValue': 9,
|
|
187
|
+
'expect': true
|
|
187
188
|
},
|
|
188
189
|
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
'inputName': 'number 1.23',
|
|
191
|
+
'inputValue': 1.23,
|
|
192
|
+
'expect': false
|
|
192
193
|
},
|
|
193
194
|
{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
'inputName': 'string \'11\'',
|
|
196
|
+
'inputValue': '11',
|
|
197
|
+
'expect': false
|
|
197
198
|
},
|
|
198
199
|
{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
'inputName': 'string \'10\'',
|
|
201
|
+
'inputValue': '10',
|
|
202
|
+
'expect': true
|
|
202
203
|
},
|
|
203
204
|
{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
'inputName': 'string \'-1\'',
|
|
206
|
+
'inputValue': '-1',
|
|
207
|
+
'expect': true
|
|
207
208
|
},
|
|
208
209
|
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
'inputName': 'string \'9\'',
|
|
211
|
+
'inputValue': '9',
|
|
212
|
+
'expect': true
|
|
212
213
|
},
|
|
213
214
|
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
'inputName': 'string \'1.23\'',
|
|
216
|
+
'inputValue': '1.23',
|
|
217
|
+
'expect': false
|
|
217
218
|
},
|
|
218
219
|
...defaultItemss({
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
'number 0': true,
|
|
221
|
+
'number 1': true
|
|
221
222
|
})
|
|
222
223
|
]
|
|
223
224
|
},
|
|
224
225
|
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
'name': 'Integer between -12 and 25',
|
|
227
|
+
'rule': ['$.string', 'int(-12, 25)'],
|
|
228
|
+
'items': [
|
|
228
229
|
{
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
'inputName': 'number -1',
|
|
231
|
+
'inputValue': -1,
|
|
232
|
+
'expect': true
|
|
232
233
|
},
|
|
233
234
|
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
'inputName': 'number -12',
|
|
236
|
+
'inputValue': -12,
|
|
237
|
+
'expect': true
|
|
237
238
|
},
|
|
238
239
|
{
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
'inputName': 'number 25',
|
|
241
|
+
'inputValue': 25,
|
|
242
|
+
'expect': true
|
|
242
243
|
},
|
|
243
244
|
{
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
'inputName': 'number 26',
|
|
246
|
+
'inputValue': 26,
|
|
247
|
+
'expect': false
|
|
247
248
|
},
|
|
248
249
|
{
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
'inputName': 'number -13',
|
|
251
|
+
'inputValue': -13,
|
|
252
|
+
'expect': false
|
|
252
253
|
},
|
|
253
254
|
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
'inputName': 'number -11.5',
|
|
256
|
+
'inputValue': -11.5,
|
|
257
|
+
'expect': false
|
|
257
258
|
},
|
|
258
259
|
{
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
'inputName': 'number 1.23',
|
|
261
|
+
'inputValue': 1.23,
|
|
262
|
+
'expect': false
|
|
262
263
|
},
|
|
263
264
|
{
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
'inputName': 'string \'-1\'',
|
|
266
|
+
'inputValue': '-1',
|
|
267
|
+
'expect': true
|
|
267
268
|
},
|
|
268
269
|
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
'inputName': 'string \'-12\'',
|
|
271
|
+
'inputValue': '-12',
|
|
272
|
+
'expect': true
|
|
272
273
|
},
|
|
273
274
|
{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
'inputName': 'string \'25\'',
|
|
276
|
+
'inputValue': '25',
|
|
277
|
+
'expect': true
|
|
277
278
|
},
|
|
278
279
|
{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
'inputName': 'string \'26\'',
|
|
281
|
+
'inputValue': '26',
|
|
282
|
+
'expect': false
|
|
282
283
|
},
|
|
283
284
|
{
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
'inputName': 'string \'-13\'',
|
|
286
|
+
'inputValue': '-13',
|
|
287
|
+
'expect': false
|
|
287
288
|
},
|
|
288
289
|
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
'inputName': 'string \'-11.5\'',
|
|
291
|
+
'inputValue': '-11.5',
|
|
292
|
+
'expect': false
|
|
292
293
|
},
|
|
293
294
|
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
'inputName': 'string \'1.23\'',
|
|
296
|
+
'inputValue': '1.23',
|
|
297
|
+
'expect': false
|
|
297
298
|
},
|
|
298
299
|
...defaultItemss({
|
|
299
|
-
|
|
300
|
-
|
|
300
|
+
'number 0': true,
|
|
301
|
+
'number 1': true
|
|
301
302
|
})
|
|
302
303
|
]
|
|
303
304
|
},
|
|
304
305
|
{
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
'name': 'Integer between -0x80 and 0x7F',
|
|
307
|
+
'rule': ['$.string', 'int8'],
|
|
308
|
+
'items': [
|
|
308
309
|
{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
'inputName': 'number -1',
|
|
311
|
+
'inputValue': -1,
|
|
312
|
+
'expect': true
|
|
312
313
|
},
|
|
313
314
|
{
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
'inputName': 'number -0x80',
|
|
316
|
+
'inputValue': -0x80,
|
|
317
|
+
'expect': true
|
|
317
318
|
},
|
|
318
319
|
{
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
'inputName': 'number 0x7F',
|
|
321
|
+
'inputValue': 0x7F,
|
|
322
|
+
'expect': true
|
|
322
323
|
},
|
|
323
324
|
{
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
'inputName': 'number 0x80',
|
|
326
|
+
'inputValue': 0x80,
|
|
327
|
+
'expect': false
|
|
327
328
|
},
|
|
328
329
|
{
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
'inputName': 'number -0x81',
|
|
331
|
+
'inputValue': -0x81,
|
|
332
|
+
'expect': false
|
|
332
333
|
},
|
|
333
334
|
{
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
'inputName': 'number 1.23',
|
|
336
|
+
'inputValue': 1.23,
|
|
337
|
+
'expect': false
|
|
337
338
|
},
|
|
338
339
|
{
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
'inputName': 'number -1.23',
|
|
341
|
+
'inputValue': -1.23,
|
|
342
|
+
'expect': false
|
|
342
343
|
},
|
|
343
344
|
{
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
'inputName': 'string \'-1\'',
|
|
346
|
+
'inputValue': (-1).toString(),
|
|
347
|
+
'expect': true
|
|
347
348
|
},
|
|
348
349
|
{
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
'inputName': 'string \'-0x80\'',
|
|
351
|
+
'inputValue': (-0x80).toString(),
|
|
352
|
+
'expect': true
|
|
352
353
|
},
|
|
353
354
|
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
'inputName': 'string \'0x7F\'',
|
|
356
|
+
'inputValue': (0x7F).toString(),
|
|
357
|
+
'expect': true
|
|
357
358
|
},
|
|
358
359
|
{
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
360
|
+
'inputName': 'string \'0x80\'',
|
|
361
|
+
'inputValue': (0x80).toString(),
|
|
362
|
+
'expect': false
|
|
362
363
|
},
|
|
363
364
|
{
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
'inputName': 'string \'-0x81\'',
|
|
366
|
+
'inputValue': (-0x81).toString(),
|
|
367
|
+
'expect': false
|
|
367
368
|
},
|
|
368
369
|
{
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
'inputName': 'string \'1.23\'',
|
|
371
|
+
'inputValue': (1.23).toString(),
|
|
372
|
+
'expect': false
|
|
372
373
|
},
|
|
373
374
|
{
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
'inputName': 'string \'-1.23\'',
|
|
376
|
+
'inputValue': (-1.23).toString(),
|
|
377
|
+
'expect': false
|
|
377
378
|
},
|
|
378
379
|
...defaultItemss({
|
|
379
|
-
|
|
380
|
-
|
|
380
|
+
'number 0': true,
|
|
381
|
+
'number 1': true
|
|
381
382
|
})
|
|
382
383
|
]
|
|
383
384
|
},
|
|
384
385
|
{
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
'name': 'Integer between -0x8000 and 0x7FFF',
|
|
387
|
+
'rule': ['$.string', 'int16'],
|
|
388
|
+
'items': [
|
|
388
389
|
{
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
390
|
+
'inputName': 'number -1',
|
|
391
|
+
'inputValue': -1,
|
|
392
|
+
'expect': true
|
|
392
393
|
},
|
|
393
394
|
{
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
'inputName': 'number -0x8000',
|
|
396
|
+
'inputValue': -0x8000,
|
|
397
|
+
'expect': true
|
|
397
398
|
},
|
|
398
399
|
{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
'inputName': 'number 0x7FFF',
|
|
401
|
+
'inputValue': 0x7FFF,
|
|
402
|
+
'expect': true
|
|
402
403
|
},
|
|
403
404
|
{
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
'inputName': 'number 0x8000',
|
|
406
|
+
'inputValue': 0x8000,
|
|
407
|
+
'expect': false
|
|
407
408
|
},
|
|
408
409
|
{
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
'inputName': 'number -0x8001',
|
|
411
|
+
'inputValue': -0x8001,
|
|
412
|
+
'expect': false
|
|
412
413
|
},
|
|
413
414
|
{
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
'inputName': 'number 1.23',
|
|
416
|
+
'inputValue': 1.23,
|
|
417
|
+
'expect': false
|
|
417
418
|
},
|
|
418
419
|
{
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
'inputName': 'number -1.23',
|
|
421
|
+
'inputValue': -1.23,
|
|
422
|
+
'expect': false
|
|
422
423
|
},
|
|
423
424
|
{
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
'inputName': 'string \'-1\'',
|
|
426
|
+
'inputValue': (-1).toString(),
|
|
427
|
+
'expect': true
|
|
427
428
|
},
|
|
428
429
|
{
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
'inputName': 'string \'-0x8000\'',
|
|
431
|
+
'inputValue': (-0x8000).toString(),
|
|
432
|
+
'expect': true
|
|
432
433
|
},
|
|
433
434
|
{
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
'inputName': 'string \'0x7FFF\'',
|
|
436
|
+
'inputValue': (0x7FFF).toString(),
|
|
437
|
+
'expect': true
|
|
437
438
|
},
|
|
438
439
|
{
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
'inputName': 'string \'0x8000\'',
|
|
441
|
+
'inputValue': (0x8000).toString(),
|
|
442
|
+
'expect': false
|
|
442
443
|
},
|
|
443
444
|
{
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
445
|
+
'inputName': 'string \'-0x8001\'',
|
|
446
|
+
'inputValue': (-0x8001).toString(),
|
|
447
|
+
'expect': false
|
|
447
448
|
},
|
|
448
449
|
{
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
'inputName': 'string \'1.23\'',
|
|
451
|
+
'inputValue': (1.23).toString(),
|
|
452
|
+
'expect': false
|
|
452
453
|
},
|
|
453
454
|
{
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
'inputName': 'string \'-1.23\'',
|
|
456
|
+
'inputValue': (-1.23).toString(),
|
|
457
|
+
'expect': false
|
|
457
458
|
},
|
|
458
459
|
...defaultItemss({
|
|
459
|
-
|
|
460
|
-
|
|
460
|
+
'number 0': true,
|
|
461
|
+
'number 1': true
|
|
461
462
|
})
|
|
462
463
|
]
|
|
463
464
|
},
|
|
464
465
|
{
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
466
|
+
'name': 'Integer between -0x80000000 and 0x7FFFFFFF',
|
|
467
|
+
'rule': ['$.string', 'int32'],
|
|
468
|
+
'items': [
|
|
468
469
|
{
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
'inputName': 'number -1',
|
|
471
|
+
'inputValue': -1,
|
|
472
|
+
'expect': true
|
|
472
473
|
},
|
|
473
474
|
{
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
475
|
+
'inputName': 'number -0x80000000',
|
|
476
|
+
'inputValue': -0x80000000,
|
|
477
|
+
'expect': true
|
|
477
478
|
},
|
|
478
479
|
{
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
'inputName': 'number 0x7FFFFFFF',
|
|
481
|
+
'inputValue': 0x7FFFFFFF,
|
|
482
|
+
'expect': true
|
|
482
483
|
},
|
|
483
484
|
{
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
'inputName': 'number 0x80000000',
|
|
486
|
+
'inputValue': 0x80000000,
|
|
487
|
+
'expect': false
|
|
487
488
|
},
|
|
488
489
|
{
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
490
|
+
'inputName': 'number -0x80000001',
|
|
491
|
+
'inputValue': -0x80000001,
|
|
492
|
+
'expect': false
|
|
492
493
|
},
|
|
493
494
|
{
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
495
|
+
'inputName': 'number 1.23',
|
|
496
|
+
'inputValue': 1.23,
|
|
497
|
+
'expect': false
|
|
497
498
|
},
|
|
498
499
|
{
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
500
|
+
'inputName': 'number -1.23',
|
|
501
|
+
'inputValue': -1.23,
|
|
502
|
+
'expect': false
|
|
502
503
|
},
|
|
503
504
|
{
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
'inputName': 'string \'-1\'',
|
|
506
|
+
'inputValue': (-1).toString(),
|
|
507
|
+
'expect': true
|
|
507
508
|
},
|
|
508
509
|
{
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
510
|
+
'inputName': 'string \'-0x80000000\'',
|
|
511
|
+
'inputValue': (-0x80000000).toString(),
|
|
512
|
+
'expect': true
|
|
512
513
|
},
|
|
513
514
|
{
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
'inputName': 'string \'0x7FFFFFFF\'',
|
|
516
|
+
'inputValue': (0x7FFFFFFF).toString(),
|
|
517
|
+
'expect': true
|
|
517
518
|
},
|
|
518
519
|
{
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
520
|
+
'inputName': 'string \'0x80000000\'',
|
|
521
|
+
'inputValue': (0x80000000).toString(),
|
|
522
|
+
'expect': false
|
|
522
523
|
},
|
|
523
524
|
{
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
525
|
+
'inputName': 'string \'-0x80000001\'',
|
|
526
|
+
'inputValue': (-0x80000001).toString(),
|
|
527
|
+
'expect': false
|
|
527
528
|
},
|
|
528
529
|
{
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
530
|
+
'inputName': 'string \'1.23\'',
|
|
531
|
+
'inputValue': (1.23).toString(),
|
|
532
|
+
'expect': false
|
|
532
533
|
},
|
|
533
534
|
{
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
535
|
+
'inputName': 'string \'-1.23\'',
|
|
536
|
+
'inputValue': (-1.23).toString(),
|
|
537
|
+
'expect': false
|
|
537
538
|
},
|
|
538
539
|
...defaultItemss({
|
|
539
|
-
|
|
540
|
-
|
|
540
|
+
'number 0': true,
|
|
541
|
+
'number 1': true
|
|
541
542
|
})
|
|
542
543
|
]
|
|
543
544
|
},
|
|
544
545
|
{
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
546
|
+
'name': '64-bits integer',
|
|
547
|
+
'rule': ['$.string', 'int64'],
|
|
548
|
+
'items': [
|
|
548
549
|
{
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
550
|
+
'inputName': 'number -1',
|
|
551
|
+
'inputValue': -1,
|
|
552
|
+
'expect': true
|
|
552
553
|
},
|
|
553
554
|
{
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
'inputName': 'number -0x8000000000000000',
|
|
556
|
+
'inputValue': -0x8000000000000000,
|
|
557
|
+
'expect': true
|
|
557
558
|
},
|
|
558
559
|
{
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
560
|
+
'inputName': 'number 0x7FFFFFFF',
|
|
561
|
+
'inputValue': 0x7FFFFFFF,
|
|
562
|
+
'expect': true
|
|
562
563
|
},
|
|
563
564
|
{
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
565
|
+
'inputName': 'number 0x7FFFFFFFFFFFFFFF',
|
|
566
|
+
'inputValue': 0x7FFFFFFFFFFFFFFF,
|
|
567
|
+
'expect': true
|
|
567
568
|
},
|
|
568
569
|
{
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
'inputName': 'number 1.23',
|
|
571
|
+
'inputValue': 1.23,
|
|
572
|
+
'expect': false
|
|
572
573
|
},
|
|
573
574
|
{
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
575
|
+
'inputName': 'number -1.23',
|
|
576
|
+
'inputValue': -1.23,
|
|
577
|
+
'expect': false
|
|
577
578
|
},
|
|
578
579
|
{
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
'inputName': 'string \'-1\'',
|
|
581
|
+
'inputValue': (-1).toString(),
|
|
582
|
+
'expect': true
|
|
582
583
|
},
|
|
583
584
|
{
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
585
|
+
'inputName': 'string \'-0x8000000000000000\'',
|
|
586
|
+
'inputValue': (-0x8000000000000000).toString(),
|
|
587
|
+
'expect': true
|
|
587
588
|
},
|
|
588
589
|
{
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
590
|
+
'inputName': 'string \'0x7FFFFFFF\'',
|
|
591
|
+
'inputValue': (0x7FFFFFFF).toString(),
|
|
592
|
+
'expect': true
|
|
592
593
|
},
|
|
593
594
|
{
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
595
|
+
'inputName': 'string \'0x7FFFFFFFFFFFFFFF\'',
|
|
596
|
+
'inputValue': (0x7FFFFFFFFFFFFFFF).toString(),
|
|
597
|
+
'expect': true
|
|
597
598
|
},
|
|
598
599
|
{
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
600
|
+
'inputName': 'string \'1.23\'',
|
|
601
|
+
'inputValue': (1.23).toString(),
|
|
602
|
+
'expect': false
|
|
602
603
|
},
|
|
603
604
|
{
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
605
|
+
'inputName': 'string \'-1.23\'',
|
|
606
|
+
'inputValue': (-1.23).toString(),
|
|
607
|
+
'expect': false
|
|
607
608
|
},
|
|
608
609
|
...defaultItemss({
|
|
609
|
-
|
|
610
|
-
|
|
610
|
+
'number 0': true,
|
|
611
|
+
'number 1': true
|
|
611
612
|
})
|
|
612
613
|
]
|
|
613
614
|
},
|
|
614
615
|
{
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
616
|
+
'name': 'Integer larger than -1',
|
|
617
|
+
'rule': ['$.string', 'uint'],
|
|
618
|
+
'items': [
|
|
618
619
|
{
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
620
|
+
'inputName': 'number -1',
|
|
621
|
+
'inputValue': -1,
|
|
622
|
+
'expect': false
|
|
622
623
|
},
|
|
623
624
|
{
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
625
|
+
'inputName': 'number 1.23',
|
|
626
|
+
'inputValue': 1.23,
|
|
627
|
+
'expect': false
|
|
627
628
|
},
|
|
628
629
|
{
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
630
|
+
'inputName': 'string \'-1\'',
|
|
631
|
+
'inputValue': (-1).toString(),
|
|
632
|
+
'expect': false
|
|
632
633
|
},
|
|
633
634
|
{
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
635
|
+
'inputName': 'string \'1.23\'',
|
|
636
|
+
'inputValue': (1.23).toString(),
|
|
637
|
+
'expect': false
|
|
637
638
|
},
|
|
638
639
|
{
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
640
|
+
'inputName': 'string \'1\'',
|
|
641
|
+
'inputValue': (1).toString(),
|
|
642
|
+
'expect': true
|
|
642
643
|
},
|
|
643
644
|
{
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
645
|
+
'inputName': 'string \'0\'',
|
|
646
|
+
'inputValue': (0).toString(),
|
|
647
|
+
'expect': true
|
|
647
648
|
},
|
|
648
649
|
...defaultItemss({
|
|
649
|
-
|
|
650
|
-
|
|
650
|
+
'number 0': true,
|
|
651
|
+
'number 1': true
|
|
651
652
|
})
|
|
652
653
|
]
|
|
653
654
|
},
|
|
654
655
|
{
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
656
|
+
'name': 'Integer between 0 and 0xFF',
|
|
657
|
+
'rule': ['$.string', 'uint8'],
|
|
658
|
+
'items': [
|
|
658
659
|
{
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
660
|
+
'inputName': 'number -1',
|
|
661
|
+
'inputValue': -1,
|
|
662
|
+
'expect': false
|
|
662
663
|
},
|
|
663
664
|
{
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
665
|
+
'inputName': 'number 0xFF',
|
|
666
|
+
'inputValue': 0xFF,
|
|
667
|
+
'expect': true
|
|
667
668
|
},
|
|
668
669
|
{
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
670
|
+
'inputName': 'number 0x100',
|
|
671
|
+
'inputValue': 0x100,
|
|
672
|
+
'expect': false
|
|
672
673
|
},
|
|
673
674
|
{
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
675
|
+
'inputName': 'number 1.23',
|
|
676
|
+
'inputValue': 1.23,
|
|
677
|
+
'expect': false
|
|
677
678
|
},
|
|
678
679
|
{
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
680
|
+
'inputName': 'number -1.23',
|
|
681
|
+
'inputValue': -1.23,
|
|
682
|
+
'expect': false
|
|
682
683
|
},
|
|
683
684
|
{
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
685
|
+
'inputName': 'string \'-1\'',
|
|
686
|
+
'inputValue': (-1).toString(),
|
|
687
|
+
'expect': false
|
|
687
688
|
},
|
|
688
689
|
{
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
690
|
+
'inputName': 'string \'0xFF\'',
|
|
691
|
+
'inputValue': (0xFF).toString(),
|
|
692
|
+
'expect': true
|
|
692
693
|
},
|
|
693
694
|
{
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
'inputName': 'string \'0x100\'',
|
|
696
|
+
'inputValue': (0x100).toString(),
|
|
697
|
+
'expect': false
|
|
697
698
|
},
|
|
698
699
|
{
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
700
|
+
'inputName': 'string \'1.23\'',
|
|
701
|
+
'inputValue': (1.23).toString(),
|
|
702
|
+
'expect': false
|
|
702
703
|
},
|
|
703
704
|
{
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
'inputName': 'string \'-1.23\'',
|
|
706
|
+
'inputValue': (-1.23).toString(),
|
|
707
|
+
'expect': false
|
|
707
708
|
},
|
|
708
709
|
...defaultItemss({
|
|
709
|
-
|
|
710
|
-
|
|
710
|
+
'number 0': true,
|
|
711
|
+
'number 1': true
|
|
711
712
|
})
|
|
712
713
|
]
|
|
713
714
|
},
|
|
714
715
|
{
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
716
|
+
'name': 'Integer between 0 and 0xFFFF',
|
|
717
|
+
'rule': ['$.string', 'uint16'],
|
|
718
|
+
'items': [
|
|
718
719
|
{
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
720
|
+
'inputName': 'number -1',
|
|
721
|
+
'inputValue': -1,
|
|
722
|
+
'expect': false
|
|
722
723
|
},
|
|
723
724
|
{
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
725
|
+
'inputName': 'number 0xFFFF',
|
|
726
|
+
'inputValue': 0xFFFF,
|
|
727
|
+
'expect': true
|
|
727
728
|
},
|
|
728
729
|
{
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
730
|
+
'inputName': 'number 0x10000',
|
|
731
|
+
'inputValue': 0x10000,
|
|
732
|
+
'expect': false
|
|
732
733
|
},
|
|
733
734
|
{
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
735
|
+
'inputName': 'number 1.23',
|
|
736
|
+
'inputValue': 1.23,
|
|
737
|
+
'expect': false
|
|
737
738
|
},
|
|
738
739
|
{
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
740
|
+
'inputName': 'number -1.23',
|
|
741
|
+
'inputValue': -1.23,
|
|
742
|
+
'expect': false
|
|
742
743
|
},
|
|
743
744
|
{
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
745
|
+
'inputName': 'string \'-1\'',
|
|
746
|
+
'inputValue': (-1).toString(),
|
|
747
|
+
'expect': false
|
|
747
748
|
},
|
|
748
749
|
{
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
750
|
+
'inputName': 'string \'0xFFFF\'',
|
|
751
|
+
'inputValue': (0xFFFF).toString(),
|
|
752
|
+
'expect': true
|
|
752
753
|
},
|
|
753
754
|
{
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
755
|
+
'inputName': 'string \'0x10000\'',
|
|
756
|
+
'inputValue': (0x10000).toString(),
|
|
757
|
+
'expect': false
|
|
757
758
|
},
|
|
758
759
|
{
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
760
|
+
'inputName': 'string \'1.23\'',
|
|
761
|
+
'inputValue': (1.23).toString(),
|
|
762
|
+
'expect': false
|
|
762
763
|
},
|
|
763
764
|
{
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
765
|
+
'inputName': 'string \'-1.23\'',
|
|
766
|
+
'inputValue': (-1.23).toString(),
|
|
767
|
+
'expect': false
|
|
767
768
|
},
|
|
768
769
|
...defaultItemss({
|
|
769
|
-
|
|
770
|
-
|
|
770
|
+
'number 0': true,
|
|
771
|
+
'number 1': true
|
|
771
772
|
})
|
|
772
773
|
]
|
|
773
774
|
},
|
|
774
775
|
{
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
776
|
+
'name': 'Integer between 0 and 0xFFFFFFFF',
|
|
777
|
+
'rule': ['$.string', 'uint32'],
|
|
778
|
+
'items': [
|
|
778
779
|
{
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
780
|
+
'inputName': 'number -1',
|
|
781
|
+
'inputValue': -1,
|
|
782
|
+
'expect': false
|
|
782
783
|
},
|
|
783
784
|
{
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
785
|
+
'inputName': 'number 0xFFFFFFFF',
|
|
786
|
+
'inputValue': 0xFFFFFFFF,
|
|
787
|
+
'expect': true
|
|
787
788
|
},
|
|
788
789
|
{
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
790
|
+
'inputName': 'number 0x100000000',
|
|
791
|
+
'inputValue': 0x100000000,
|
|
792
|
+
'expect': false
|
|
792
793
|
},
|
|
793
794
|
{
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
'inputName': 'number 1.23',
|
|
796
|
+
'inputValue': 1.23,
|
|
797
|
+
'expect': false
|
|
797
798
|
},
|
|
798
799
|
{
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
800
|
+
'inputName': 'number -1.23',
|
|
801
|
+
'inputValue': -1.23,
|
|
802
|
+
'expect': false
|
|
802
803
|
},
|
|
803
804
|
{
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
805
|
+
'inputName': 'string \'-1\'',
|
|
806
|
+
'inputValue': (-1).toString(),
|
|
807
|
+
'expect': false
|
|
807
808
|
},
|
|
808
809
|
{
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
810
|
+
'inputName': 'string \'0xFFFFFFFF\'',
|
|
811
|
+
'inputValue': (0xFFFFFFFF).toString(),
|
|
812
|
+
'expect': true
|
|
812
813
|
},
|
|
813
814
|
{
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
815
|
+
'inputName': 'string \'0x100000000\'',
|
|
816
|
+
'inputValue': (0x100000000).toString(),
|
|
817
|
+
'expect': false
|
|
817
818
|
},
|
|
818
819
|
{
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
820
|
+
'inputName': 'string \'1.23\'',
|
|
821
|
+
'inputValue': (1.23).toString(),
|
|
822
|
+
'expect': false
|
|
822
823
|
},
|
|
823
824
|
{
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
825
|
+
'inputName': 'string \'-1.23\'',
|
|
826
|
+
'inputValue': (-1.23).toString(),
|
|
827
|
+
'expect': false
|
|
827
828
|
},
|
|
828
829
|
...defaultItemss({
|
|
829
|
-
|
|
830
|
-
|
|
830
|
+
'number 0': true,
|
|
831
|
+
'number 1': true
|
|
831
832
|
})
|
|
832
833
|
]
|
|
833
834
|
},
|
|
834
835
|
{
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
836
|
+
'name': 'Integer between 0 and 0xFFFFFFFFFFFFFFFF',
|
|
837
|
+
'rule': ['$.string', 'uint64'],
|
|
838
|
+
'items': [
|
|
838
839
|
{
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
840
|
+
'inputName': 'number -1',
|
|
841
|
+
'inputValue': -1,
|
|
842
|
+
'expect': false
|
|
842
843
|
},
|
|
843
844
|
{
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
845
|
+
'inputName': 'number 0xFFFFFFFFFFFFFFFF',
|
|
846
|
+
'inputValue': 0xFFFFFFFFFFFFFFFF,
|
|
847
|
+
'expect': true
|
|
847
848
|
},
|
|
848
849
|
{
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
850
|
+
'inputName': 'number 0x7FFFFFFF',
|
|
851
|
+
'inputValue': 0x7FFFFFFF,
|
|
852
|
+
'expect': true
|
|
852
853
|
},
|
|
853
854
|
{
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
855
|
+
'inputName': 'number 1.23',
|
|
856
|
+
'inputValue': 1.23,
|
|
857
|
+
'expect': false
|
|
857
858
|
},
|
|
858
859
|
{
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
860
|
+
'inputName': 'number -1.23',
|
|
861
|
+
'inputValue': -1.23,
|
|
862
|
+
'expect': false
|
|
862
863
|
},
|
|
863
864
|
{
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
865
|
+
'inputName': 'string \'-1\'',
|
|
866
|
+
'inputValue': (-1).toString(),
|
|
867
|
+
'expect': false
|
|
867
868
|
},
|
|
868
869
|
{
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
870
|
+
'inputName': 'string \'0xFFFFFFFFFFFFFFFF\'',
|
|
871
|
+
'inputValue': (0xFFFFFFFFFFFFFFFF).toString(),
|
|
872
|
+
'expect': true
|
|
872
873
|
},
|
|
873
874
|
{
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
875
|
+
'inputName': 'string \'0x7FFFFFFF\'',
|
|
876
|
+
'inputValue': (0x7FFFFFFF).toString(),
|
|
877
|
+
'expect': true
|
|
877
878
|
},
|
|
878
879
|
{
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
880
|
+
'inputName': 'string \'1.23\'',
|
|
881
|
+
'inputValue': (1.23).toString(),
|
|
882
|
+
'expect': false
|
|
882
883
|
},
|
|
883
884
|
{
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
885
|
+
'inputName': 'string \'-1.23\'',
|
|
886
|
+
'inputValue': (-1.23).toString(),
|
|
887
|
+
'expect': false
|
|
887
888
|
},
|
|
888
889
|
...defaultItemss({
|
|
889
|
-
|
|
890
|
-
|
|
890
|
+
'number 0': true,
|
|
891
|
+
'number 1': true
|
|
891
892
|
})
|
|
892
893
|
]
|
|
893
894
|
},
|
|
894
895
|
{
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
896
|
+
'name': 'Accuracy safe integer',
|
|
897
|
+
'rule': ['$.string', 'safe_int'],
|
|
898
|
+
'items': [
|
|
898
899
|
{
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
900
|
+
'inputName': 'number -1',
|
|
901
|
+
'inputValue': -1,
|
|
902
|
+
'expect': true
|
|
902
903
|
},
|
|
903
904
|
{
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
905
|
+
'inputName': 'number 9007199254740991',
|
|
906
|
+
'inputValue': 9007199254740991,
|
|
907
|
+
'expect': true
|
|
907
908
|
},
|
|
908
909
|
{
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
910
|
+
'inputName': 'number -9007199254740991',
|
|
911
|
+
'inputValue': -9007199254740991,
|
|
912
|
+
'expect': true
|
|
912
913
|
},
|
|
913
914
|
{
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
915
|
+
'inputName': 'number 9007199254740992',
|
|
916
|
+
'inputValue': 9007199254740992,
|
|
917
|
+
'expect': false
|
|
917
918
|
},
|
|
918
919
|
{
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
920
|
+
'inputName': 'number -9007199254740992',
|
|
921
|
+
'inputValue': -9007199254740992,
|
|
922
|
+
'expect': false
|
|
922
923
|
},
|
|
923
924
|
{
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
925
|
+
'inputName': 'number 1.23',
|
|
926
|
+
'inputValue': 1.23,
|
|
927
|
+
'expect': false
|
|
927
928
|
},
|
|
928
929
|
{
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
930
|
+
'inputName': 'number -1.23',
|
|
931
|
+
'inputValue': -1.23,
|
|
932
|
+
'expect': false
|
|
932
933
|
},
|
|
933
934
|
{
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
935
|
+
'inputName': 'string \'-1\'',
|
|
936
|
+
'inputValue': (-1).toString(),
|
|
937
|
+
'expect': true
|
|
937
938
|
},
|
|
938
939
|
{
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
940
|
+
'inputName': 'string \'9007199254740991\'',
|
|
941
|
+
'inputValue': (9007199254740991).toString(),
|
|
942
|
+
'expect': true
|
|
942
943
|
},
|
|
943
944
|
{
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
945
|
+
'inputName': 'string \'-9007199254740991\'',
|
|
946
|
+
'inputValue': (-9007199254740991).toString(),
|
|
947
|
+
'expect': true
|
|
947
948
|
},
|
|
948
949
|
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
950
|
+
'inputName': 'string \'9007199254740992\'',
|
|
951
|
+
'inputValue': (9007199254740992).toString(),
|
|
952
|
+
'expect': false
|
|
952
953
|
},
|
|
953
954
|
{
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
955
|
+
'inputName': 'string \'-9007199254740992\'',
|
|
956
|
+
'inputValue': (-9007199254740992).toString(),
|
|
957
|
+
'expect': false
|
|
957
958
|
},
|
|
958
959
|
{
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
960
|
+
'inputName': 'string \'1.23\'',
|
|
961
|
+
'inputValue': (1.23).toString(),
|
|
962
|
+
'expect': false
|
|
962
963
|
},
|
|
963
964
|
{
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
965
|
+
'inputName': 'string \'-1.23\'',
|
|
966
|
+
'inputValue': (-1.23).toString(),
|
|
967
|
+
'expect': false
|
|
967
968
|
},
|
|
968
969
|
...defaultItemss({
|
|
969
|
-
|
|
970
|
-
|
|
970
|
+
'number 0': true,
|
|
971
|
+
'number 1': true
|
|
971
972
|
})
|
|
972
973
|
]
|
|
973
974
|
},
|
|
974
975
|
{
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
976
|
+
'name': 'Accuracy safe unsigned integer',
|
|
977
|
+
'rule': ['$.string', 'safe_uint'],
|
|
978
|
+
'items': [
|
|
978
979
|
{
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
980
|
+
'inputName': 'number -1',
|
|
981
|
+
'inputValue': -1,
|
|
982
|
+
'expect': false
|
|
982
983
|
},
|
|
983
984
|
{
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
985
|
+
'inputName': 'number 9007199254740991',
|
|
986
|
+
'inputValue': 9007199254740991,
|
|
987
|
+
'expect': true
|
|
987
988
|
},
|
|
988
989
|
{
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
990
|
+
'inputName': 'number 9007199254740992',
|
|
991
|
+
'inputValue': 9007199254740992,
|
|
992
|
+
'expect': false
|
|
992
993
|
},
|
|
993
994
|
{
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
995
|
+
'inputName': 'number 1.23',
|
|
996
|
+
'inputValue': 1.23,
|
|
997
|
+
'expect': false
|
|
997
998
|
},
|
|
998
999
|
{
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1000
|
+
'inputName': 'number -1.23',
|
|
1001
|
+
'inputValue': -1.23,
|
|
1002
|
+
'expect': false
|
|
1002
1003
|
},
|
|
1003
1004
|
{
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1005
|
+
'inputName': 'string \'-1\'',
|
|
1006
|
+
'inputValue': (-1).toString(),
|
|
1007
|
+
'expect': false
|
|
1007
1008
|
},
|
|
1008
1009
|
{
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1010
|
+
'inputName': 'string \'9007199254740991\'',
|
|
1011
|
+
'inputValue': (9007199254740991).toString(),
|
|
1012
|
+
'expect': true
|
|
1012
1013
|
},
|
|
1013
1014
|
{
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1015
|
+
'inputName': 'string \'9007199254740992\'',
|
|
1016
|
+
'inputValue': (9007199254740992).toString(),
|
|
1017
|
+
'expect': false
|
|
1017
1018
|
},
|
|
1018
1019
|
{
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1020
|
+
'inputName': 'string \'1.23\'',
|
|
1021
|
+
'inputValue': (1.23).toString(),
|
|
1022
|
+
'expect': false
|
|
1022
1023
|
},
|
|
1023
1024
|
{
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1025
|
+
'inputName': 'string \'-1.23\'',
|
|
1026
|
+
'inputValue': (-1.23).toString(),
|
|
1027
|
+
'expect': false
|
|
1027
1028
|
},
|
|
1028
1029
|
...defaultItemss({
|
|
1029
|
-
|
|
1030
|
-
|
|
1030
|
+
'number 0': true,
|
|
1031
|
+
'number 1': true
|
|
1031
1032
|
})
|
|
1032
1033
|
]
|
|
1033
1034
|
},
|
|
1034
1035
|
{
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1036
|
+
'name': 'Float number',
|
|
1037
|
+
'rule': ['$.string', 'float'],
|
|
1038
|
+
'items': [
|
|
1038
1039
|
{
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1040
|
+
'inputName': 'number -1',
|
|
1041
|
+
'inputValue': -1,
|
|
1042
|
+
'expect': true
|
|
1042
1043
|
},
|
|
1043
1044
|
{
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1045
|
+
'inputName': 'number 120312',
|
|
1046
|
+
'inputValue': 120312,
|
|
1047
|
+
'expect': true
|
|
1047
1048
|
},
|
|
1048
1049
|
{
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1050
|
+
'inputName': 'number 1.23',
|
|
1051
|
+
'inputValue': 1.23,
|
|
1052
|
+
'expect': true
|
|
1052
1053
|
},
|
|
1053
1054
|
{
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1055
|
+
'inputName': 'number -1.23',
|
|
1056
|
+
'inputValue': -1.23,
|
|
1057
|
+
'expect': true
|
|
1057
1058
|
},
|
|
1058
1059
|
{
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1060
|
+
'inputName': 'string \'-1\'',
|
|
1061
|
+
'inputValue': (-1).toString(),
|
|
1062
|
+
'expect': true
|
|
1062
1063
|
},
|
|
1063
1064
|
{
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1065
|
+
'inputName': 'string \'120312\'',
|
|
1066
|
+
'inputValue': (120312).toString(),
|
|
1067
|
+
'expect': true
|
|
1067
1068
|
},
|
|
1068
1069
|
{
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1070
|
+
'inputName': 'string \'1.23\'',
|
|
1071
|
+
'inputValue': (1.23).toString(),
|
|
1072
|
+
'expect': true
|
|
1072
1073
|
},
|
|
1073
1074
|
{
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1075
|
+
'inputName': 'string \'-1.23\'',
|
|
1076
|
+
'inputValue': (-1.23).toString(),
|
|
1077
|
+
'expect': true
|
|
1077
1078
|
},
|
|
1078
1079
|
...defaultItemss({
|
|
1079
|
-
|
|
1080
|
-
|
|
1080
|
+
'number 0': true,
|
|
1081
|
+
'number 1': true
|
|
1081
1082
|
})
|
|
1082
1083
|
]
|
|
1083
1084
|
},
|
|
1084
1085
|
{
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1086
|
+
'name': 'Unsigned float number',
|
|
1087
|
+
'rule': ['$.string', 'ufloat'],
|
|
1088
|
+
'items': [
|
|
1088
1089
|
{
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1090
|
+
'inputName': 'number -1',
|
|
1091
|
+
'inputValue': -1,
|
|
1092
|
+
'expect': false
|
|
1092
1093
|
},
|
|
1093
1094
|
{
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1095
|
+
'inputName': 'number 120312',
|
|
1096
|
+
'inputValue': 120312,
|
|
1097
|
+
'expect': true
|
|
1097
1098
|
},
|
|
1098
1099
|
{
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1100
|
+
'inputName': 'number 1.23',
|
|
1101
|
+
'inputValue': 1.23,
|
|
1102
|
+
'expect': true
|
|
1102
1103
|
},
|
|
1103
1104
|
{
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1105
|
+
'inputName': 'number -1.23',
|
|
1106
|
+
'inputValue': -1.23,
|
|
1107
|
+
'expect': false
|
|
1107
1108
|
},
|
|
1108
1109
|
{
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1110
|
+
'inputName': 'string \'-1\'',
|
|
1111
|
+
'inputValue': (-1).toString(),
|
|
1112
|
+
'expect': false
|
|
1112
1113
|
},
|
|
1113
1114
|
{
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1115
|
+
'inputName': 'string \'120312\'',
|
|
1116
|
+
'inputValue': (120312).toString(),
|
|
1117
|
+
'expect': true
|
|
1117
1118
|
},
|
|
1118
1119
|
{
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1120
|
+
'inputName': 'string \'1.23\'',
|
|
1121
|
+
'inputValue': (1.23).toString(),
|
|
1122
|
+
'expect': true
|
|
1122
1123
|
},
|
|
1123
1124
|
{
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1125
|
+
'inputName': 'string \'-1.23\'',
|
|
1126
|
+
'inputValue': (-1.23).toString(),
|
|
1127
|
+
'expect': false
|
|
1127
1128
|
},
|
|
1128
1129
|
...defaultItemss({
|
|
1129
|
-
|
|
1130
|
-
|
|
1130
|
+
'number 0': true,
|
|
1131
|
+
'number 1': true
|
|
1131
1132
|
})
|
|
1132
1133
|
]
|
|
1133
1134
|
},
|
|
1134
1135
|
{
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1136
|
+
'name': 'Number',
|
|
1137
|
+
'rule': ['$.string', 'number'],
|
|
1138
|
+
'items': [
|
|
1138
1139
|
{
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1140
|
+
'inputName': 'number -1',
|
|
1141
|
+
'inputValue': -1,
|
|
1142
|
+
'expect': true
|
|
1142
1143
|
},
|
|
1143
1144
|
{
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1145
|
+
'inputName': 'number 120312',
|
|
1146
|
+
'inputValue': 120312,
|
|
1147
|
+
'expect': true
|
|
1147
1148
|
},
|
|
1148
1149
|
{
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1150
|
+
'inputName': 'number 1.23',
|
|
1151
|
+
'inputValue': 1.23,
|
|
1152
|
+
'expect': true
|
|
1152
1153
|
},
|
|
1153
1154
|
{
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1155
|
+
'inputName': 'number -1.23',
|
|
1156
|
+
'inputValue': -1.23,
|
|
1157
|
+
'expect': true
|
|
1157
1158
|
},
|
|
1158
1159
|
{
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
'inputName': 'string \'-1\'',
|
|
1161
|
+
'inputValue': (-1).toString(),
|
|
1162
|
+
'expect': true
|
|
1162
1163
|
},
|
|
1163
1164
|
{
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1165
|
+
'inputName': 'string \'120312\'',
|
|
1166
|
+
'inputValue': (120312).toString(),
|
|
1167
|
+
'expect': true
|
|
1167
1168
|
},
|
|
1168
1169
|
{
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1170
|
+
'inputName': 'string \'1.23\'',
|
|
1171
|
+
'inputValue': (1.23).toString(),
|
|
1172
|
+
'expect': true
|
|
1172
1173
|
},
|
|
1173
1174
|
{
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1175
|
+
'inputName': 'string \'-1.23\'',
|
|
1176
|
+
'inputValue': (-1.23).toString(),
|
|
1177
|
+
'expect': true
|
|
1177
1178
|
},
|
|
1178
1179
|
...defaultItemss({
|
|
1179
|
-
|
|
1180
|
-
|
|
1180
|
+
'number 0': true,
|
|
1181
|
+
'number 1': true
|
|
1181
1182
|
})
|
|
1182
1183
|
]
|
|
1183
1184
|
},
|
|
1184
1185
|
{
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1186
|
+
'name': 'Number between 1.0, 10.0',
|
|
1187
|
+
'rule': ['$.string', 'number(1.0, 10.0)'],
|
|
1188
|
+
'items': [
|
|
1188
1189
|
{
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1190
|
+
'inputName': 'number -1',
|
|
1191
|
+
'inputValue': -1,
|
|
1192
|
+
'expect': false
|
|
1192
1193
|
},
|
|
1193
1194
|
{
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1195
|
+
'inputName': 'number 1',
|
|
1196
|
+
'inputValue': 1,
|
|
1197
|
+
'expect': true
|
|
1197
1198
|
},
|
|
1198
1199
|
{
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1200
|
+
'inputName': 'number 10',
|
|
1201
|
+
'inputValue': 10,
|
|
1202
|
+
'expect': true
|
|
1202
1203
|
},
|
|
1203
1204
|
{
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1205
|
+
'inputName': 'number 11',
|
|
1206
|
+
'inputValue': 11,
|
|
1207
|
+
'expect': false
|
|
1207
1208
|
},
|
|
1208
1209
|
{
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1210
|
+
'inputName': 'number 0',
|
|
1211
|
+
'inputValue': 0,
|
|
1212
|
+
'expect': false
|
|
1212
1213
|
},
|
|
1213
1214
|
{
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1215
|
+
'inputName': 'number 1.23',
|
|
1216
|
+
'inputValue': 1.23,
|
|
1217
|
+
'expect': true
|
|
1217
1218
|
},
|
|
1218
1219
|
{
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1220
|
+
'inputName': 'number -1.23',
|
|
1221
|
+
'inputValue': -1.23,
|
|
1222
|
+
'expect': false
|
|
1222
1223
|
},
|
|
1223
1224
|
{
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1225
|
+
'inputName': 'string \'-1\'',
|
|
1226
|
+
'inputValue': (-1).toString(),
|
|
1227
|
+
'expect': false
|
|
1227
1228
|
},
|
|
1228
1229
|
{
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1230
|
+
'inputName': 'string \'1\'',
|
|
1231
|
+
'inputValue': (1).toString(),
|
|
1232
|
+
'expect': true
|
|
1232
1233
|
},
|
|
1233
1234
|
{
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1235
|
+
'inputName': 'string \'10\'',
|
|
1236
|
+
'inputValue': (10).toString(),
|
|
1237
|
+
'expect': true
|
|
1237
1238
|
},
|
|
1238
1239
|
{
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1240
|
+
'inputName': 'string \'11\'',
|
|
1241
|
+
'inputValue': (11).toString(),
|
|
1242
|
+
'expect': false
|
|
1242
1243
|
},
|
|
1243
1244
|
{
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1245
|
+
'inputName': 'string \'0\'',
|
|
1246
|
+
'inputValue': (0).toString(),
|
|
1247
|
+
'expect': false
|
|
1247
1248
|
},
|
|
1248
1249
|
{
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1250
|
+
'inputName': 'string \'1.23\'',
|
|
1251
|
+
'inputValue': (1.23).toString(),
|
|
1252
|
+
'expect': true
|
|
1252
1253
|
},
|
|
1253
1254
|
{
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1255
|
+
'inputName': 'string \'-1.23\'',
|
|
1256
|
+
'inputValue': (-1.23).toString(),
|
|
1257
|
+
'expect': false
|
|
1257
1258
|
},
|
|
1258
1259
|
...defaultItemss({
|
|
1259
|
-
|
|
1260
|
-
|
|
1260
|
+
'number 0': false,
|
|
1261
|
+
'number 1': true
|
|
1261
1262
|
})
|
|
1262
1263
|
]
|
|
1263
1264
|
},
|
|
1264
1265
|
{
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1266
|
+
'name': 'Number larger than 1',
|
|
1267
|
+
'rule': ['$.string', 'number(1, )'],
|
|
1268
|
+
'items': [
|
|
1268
1269
|
{
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1270
|
+
'inputName': 'number -1',
|
|
1271
|
+
'inputValue': -1,
|
|
1272
|
+
'expect': false
|
|
1272
1273
|
},
|
|
1273
1274
|
{
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1275
|
+
'inputName': 'number 1',
|
|
1276
|
+
'inputValue': 1,
|
|
1277
|
+
'expect': true
|
|
1277
1278
|
},
|
|
1278
1279
|
{
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1280
|
+
'inputName': 'number 10',
|
|
1281
|
+
'inputValue': 10,
|
|
1282
|
+
'expect': true
|
|
1282
1283
|
},
|
|
1283
1284
|
{
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1285
|
+
'inputName': 'number 11',
|
|
1286
|
+
'inputValue': 11,
|
|
1287
|
+
'expect': true
|
|
1287
1288
|
},
|
|
1288
1289
|
{
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1290
|
+
'inputName': 'number 0',
|
|
1291
|
+
'inputValue': 0,
|
|
1292
|
+
'expect': false
|
|
1292
1293
|
},
|
|
1293
1294
|
{
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1295
|
+
'inputName': 'number 1.23',
|
|
1296
|
+
'inputValue': 1.23,
|
|
1297
|
+
'expect': true
|
|
1297
1298
|
},
|
|
1298
1299
|
{
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1300
|
+
'inputName': 'number -1.23',
|
|
1301
|
+
'inputValue': -1.23,
|
|
1302
|
+
'expect': false
|
|
1302
1303
|
},
|
|
1303
1304
|
{
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1305
|
+
'inputName': 'string \'-1\'',
|
|
1306
|
+
'inputValue': (-1).toString(),
|
|
1307
|
+
'expect': false
|
|
1307
1308
|
},
|
|
1308
1309
|
{
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1310
|
+
'inputName': 'string \'1\'',
|
|
1311
|
+
'inputValue': (1).toString(),
|
|
1312
|
+
'expect': true
|
|
1312
1313
|
},
|
|
1313
1314
|
{
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1315
|
+
'inputName': 'string \'10\'',
|
|
1316
|
+
'inputValue': (10).toString(),
|
|
1317
|
+
'expect': true
|
|
1317
1318
|
},
|
|
1318
1319
|
{
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1320
|
+
'inputName': 'string \'11\'',
|
|
1321
|
+
'inputValue': (11).toString(),
|
|
1322
|
+
'expect': true
|
|
1322
1323
|
},
|
|
1323
1324
|
{
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1325
|
+
'inputName': 'string \'0\'',
|
|
1326
|
+
'inputValue': (0).toString(),
|
|
1327
|
+
'expect': false
|
|
1327
1328
|
},
|
|
1328
1329
|
{
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1330
|
+
'inputName': 'string \'1.23\'',
|
|
1331
|
+
'inputValue': (1.23).toString(),
|
|
1332
|
+
'expect': true
|
|
1332
1333
|
},
|
|
1333
1334
|
{
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1335
|
+
'inputName': 'string \'-1.23\'',
|
|
1336
|
+
'inputValue': (-1.23).toString(),
|
|
1337
|
+
'expect': false
|
|
1337
1338
|
},
|
|
1338
1339
|
...defaultItemss({
|
|
1339
|
-
|
|
1340
|
-
|
|
1340
|
+
'number 0': false,
|
|
1341
|
+
'number 1': true
|
|
1341
1342
|
})
|
|
1342
1343
|
]
|
|
1343
1344
|
},
|
|
1344
1345
|
{
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1346
|
+
'name': 'Number lower than -1',
|
|
1347
|
+
'rule': ['$.string', 'number(, -1)'],
|
|
1348
|
+
'items': [
|
|
1348
1349
|
{
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1350
|
+
'inputName': 'number -1',
|
|
1351
|
+
'inputValue': -1,
|
|
1352
|
+
'expect': true
|
|
1352
1353
|
},
|
|
1353
1354
|
{
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1355
|
+
'inputName': 'number 1',
|
|
1356
|
+
'inputValue': 1,
|
|
1357
|
+
'expect': false
|
|
1357
1358
|
},
|
|
1358
1359
|
{
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1360
|
+
'inputName': 'number -0.3',
|
|
1361
|
+
'inputValue': -0.3,
|
|
1362
|
+
'expect': false
|
|
1362
1363
|
},
|
|
1363
1364
|
{
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1365
|
+
'inputName': 'number -11',
|
|
1366
|
+
'inputValue': -11,
|
|
1367
|
+
'expect': true
|
|
1367
1368
|
},
|
|
1368
1369
|
{
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1370
|
+
'inputName': 'number 0',
|
|
1371
|
+
'inputValue': 0,
|
|
1372
|
+
'expect': false
|
|
1372
1373
|
},
|
|
1373
1374
|
{
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1375
|
+
'inputName': 'number -1.23',
|
|
1376
|
+
'inputValue': -1.23,
|
|
1377
|
+
'expect': true
|
|
1377
1378
|
},
|
|
1378
1379
|
{
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1380
|
+
'inputName': 'string \'-1\'',
|
|
1381
|
+
'inputValue': (-1).toString(),
|
|
1382
|
+
'expect': true
|
|
1382
1383
|
},
|
|
1383
1384
|
{
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1385
|
+
'inputName': 'string \'1\'',
|
|
1386
|
+
'inputValue': (1).toString(),
|
|
1387
|
+
'expect': false
|
|
1387
1388
|
},
|
|
1388
1389
|
{
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1390
|
+
'inputName': 'string \'-0.3\'',
|
|
1391
|
+
'inputValue': (-0.3).toString(),
|
|
1392
|
+
'expect': false
|
|
1392
1393
|
},
|
|
1393
1394
|
{
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1395
|
+
'inputName': 'string \'-11\'',
|
|
1396
|
+
'inputValue': (-11).toString(),
|
|
1397
|
+
'expect': true
|
|
1397
1398
|
},
|
|
1398
1399
|
{
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1400
|
+
'inputName': 'string \'0\'',
|
|
1401
|
+
'inputValue': (0).toString(),
|
|
1402
|
+
'expect': false
|
|
1402
1403
|
},
|
|
1403
1404
|
{
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1405
|
+
'inputName': 'string \'-1.23\'',
|
|
1406
|
+
'inputValue': (-1.23).toString(),
|
|
1407
|
+
'expect': true
|
|
1407
1408
|
},
|
|
1408
1409
|
...defaultItemss({
|
|
1409
|
-
|
|
1410
|
-
|
|
1410
|
+
'number 0': false,
|
|
1411
|
+
'number 1': false
|
|
1411
1412
|
})
|
|
1412
1413
|
]
|
|
1413
1414
|
},
|
|
1414
1415
|
{
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1416
|
+
'name': 'Null',
|
|
1417
|
+
'rule': ['$.string', 'null'],
|
|
1418
|
+
'items': [
|
|
1418
1419
|
{
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1420
|
+
'inputName': 'string \'null\'',
|
|
1421
|
+
'inputValue': 'null',
|
|
1422
|
+
'expect': true
|
|
1422
1423
|
},
|
|
1423
1424
|
...defaultItemss({
|
|
1424
|
-
|
|
1425
|
+
'null': true
|
|
1425
1426
|
})
|
|
1426
1427
|
]
|
|
1427
1428
|
},
|
|
1428
1429
|
{
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1430
|
+
'name': 'Literal null',
|
|
1431
|
+
'rule': ['$.string', null],
|
|
1432
|
+
'items': [
|
|
1432
1433
|
{
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1434
|
+
'inputName': 'string \'null\'',
|
|
1435
|
+
'inputValue': 'null',
|
|
1436
|
+
'expect': true
|
|
1436
1437
|
},
|
|
1437
1438
|
...defaultItemss({
|
|
1438
|
-
|
|
1439
|
+
'null': true
|
|
1439
1440
|
})
|
|
1440
1441
|
]
|
|
1441
1442
|
},
|
|
1442
1443
|
{
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1444
|
+
'name': 'Literal number 1',
|
|
1445
|
+
'rule': ['$.string', 1],
|
|
1446
|
+
'items': [
|
|
1446
1447
|
{
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1448
|
+
'inputName': 'string \'1\'',
|
|
1449
|
+
'inputValue': '1',
|
|
1450
|
+
'expect': true
|
|
1450
1451
|
},
|
|
1451
1452
|
...defaultItemss({
|
|
1452
|
-
|
|
1453
|
+
'number 1': true
|
|
1453
1454
|
})
|
|
1454
1455
|
]
|
|
1455
1456
|
},
|
|
1456
1457
|
{
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1458
|
+
'name': 'Literal true',
|
|
1459
|
+
'rule': ['$.string', true],
|
|
1460
|
+
'items': [
|
|
1460
1461
|
{
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1462
|
+
'inputName': 'string \'true\'',
|
|
1463
|
+
'inputValue': 'true',
|
|
1464
|
+
'expect': true
|
|
1464
1465
|
},
|
|
1465
1466
|
...defaultItemss({
|
|
1466
|
-
|
|
1467
|
+
'true': true
|
|
1467
1468
|
})
|
|
1468
1469
|
]
|
|
1469
1470
|
},
|
|
1470
1471
|
{
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1472
|
+
'name': 'Literal false',
|
|
1473
|
+
'rule': ['$.string', false],
|
|
1474
|
+
'items': [
|
|
1474
1475
|
{
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1476
|
+
'inputName': 'string \'false\'',
|
|
1477
|
+
'inputValue': 'false',
|
|
1478
|
+
'expect': true
|
|
1478
1479
|
},
|
|
1479
1480
|
...defaultItemss({
|
|
1480
|
-
|
|
1481
|
+
'false': true
|
|
1481
1482
|
})
|
|
1482
1483
|
]
|
|
1483
1484
|
},
|