@litert/typeguard 1.0.0 → 1.2.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 +15 -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 +13 -9
- 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 +77 -72
- package/lib/Compiler.js.map +1 -1
- package/lib/Context.d.ts +2 -2
- package/lib/Context.js +3 -2
- 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 +14 -5
- package/lib/InlineCompiler.js.map +1 -1
- package/lib/Internal.d.ts +2 -1
- 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 +30 -23
- package/lib/langs/JavaScript.js.map +1 -1
- package/package.json +18 -13
- package/src/{samples → examples}/quick-start.ts +22 -12
- package/src/lib/BuiltInTypeCompiler.ts +171 -171
- package/src/lib/BuiltInTypes.ts +36 -36
- package/src/lib/Common.ts +15 -10
- package/src/lib/Compiler.ts +213 -208
- package/src/lib/Context.ts +3 -3
- package/src/lib/FilterCompiler.ts +84 -84
- package/src/lib/InlineCompiler.ts +35 -14
- package/src/lib/Internal.ts +12 -10
- package/src/lib/Modifiers.ts +2 -2
- package/src/lib/index.ts +5 -5
- package/src/lib/langs/JavaScript.ts +34 -24
- package/src/test/00-all.ts +11 -9
- 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 +67 -0
- package/src/test/abstracts.ts +52 -43
- package/dist/typeguard.amd.d.ts +0 -588
- package/dist/typeguard.amd.d.ts.map +0 -1
- package/dist/typeguard.amd.js +0 -2063
- 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 -2179
- package/dist/typeguard.system.js.map +0 -1
- 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,1945 +15,1945 @@
|
|
|
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: 'Elememetal Types',
|
|
22
23
|
sections: [
|
|
23
24
|
|
|
24
25
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
'name': 'Literal number 2113',
|
|
27
|
+
'rule': 2113,
|
|
28
|
+
'items': [
|
|
28
29
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
'inputName': 'number 2113',
|
|
31
|
+
'inputValue': 2113,
|
|
32
|
+
'expect': true
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
'inputName': 'string \'2113\'',
|
|
36
|
+
'inputValue': '2113',
|
|
37
|
+
'expect': false
|
|
37
38
|
}
|
|
38
39
|
]
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
'name': 'Literal null',
|
|
43
|
+
'rule': null,
|
|
44
|
+
'items': [
|
|
44
45
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
'inputName': 'string \'null\'',
|
|
47
|
+
'inputValue': 'null',
|
|
48
|
+
'expect': false
|
|
48
49
|
},
|
|
49
50
|
...defaultItemss({
|
|
50
|
-
|
|
51
|
+
'null': true
|
|
51
52
|
})
|
|
52
53
|
]
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
'name': 'Literal boolean value true',
|
|
57
|
+
'rule': true,
|
|
58
|
+
'items': [
|
|
58
59
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
'inputName': 'string \'true\'',
|
|
61
|
+
'inputValue': 'true',
|
|
62
|
+
'expect': false
|
|
62
63
|
},
|
|
63
64
|
...defaultItemss({
|
|
64
|
-
|
|
65
|
+
'true': true
|
|
65
66
|
})
|
|
66
67
|
]
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
'name': 'Literal boolean value false',
|
|
71
|
+
'rule': false,
|
|
72
|
+
'items': [
|
|
72
73
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
'inputName': 'string \'true\'',
|
|
75
|
+
'inputValue': 'true',
|
|
76
|
+
'expect': false
|
|
76
77
|
},
|
|
77
78
|
...defaultItemss({
|
|
78
|
-
|
|
79
|
+
'false': true
|
|
79
80
|
})
|
|
80
81
|
]
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
'name': 'String',
|
|
85
|
+
'rule': 'string',
|
|
86
|
+
'items': [
|
|
86
87
|
...defaultItemss({
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
'string \'hello\'': true,
|
|
89
|
+
'empty string': true
|
|
89
90
|
})
|
|
90
91
|
]
|
|
91
92
|
},
|
|
92
93
|
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
'name': 'String contains 5 characters',
|
|
95
|
+
'rule': 'string(5)',
|
|
96
|
+
'items': [
|
|
96
97
|
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
'inputName': 'string \'world\'',
|
|
99
|
+
'inputValue': 'world',
|
|
100
|
+
'expect': true
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
'inputName': 'string \'hi\'',
|
|
104
|
+
'inputValue': 'hi',
|
|
105
|
+
'expect': false
|
|
105
106
|
},
|
|
106
107
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
'inputName': 'string \'logical\'',
|
|
109
|
+
'inputValue': 'logical',
|
|
110
|
+
'expect': false
|
|
110
111
|
},
|
|
111
112
|
...defaultItemss({
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
'string \'hello\'': true,
|
|
114
|
+
'empty string': false
|
|
114
115
|
})
|
|
115
116
|
]
|
|
116
117
|
},
|
|
117
118
|
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
'name': 'String contains at least 5 characters',
|
|
120
|
+
'rule': 'string(5,)',
|
|
121
|
+
'items': [
|
|
121
122
|
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
'inputName': 'string \'world\'',
|
|
124
|
+
'inputValue': 'world',
|
|
125
|
+
'expect': true
|
|
125
126
|
},
|
|
126
127
|
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
'inputName': 'string \'hihi\'',
|
|
129
|
+
'inputValue': 'hihi',
|
|
130
|
+
'expect': false
|
|
130
131
|
},
|
|
131
132
|
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
'inputName': 'string \'logical\'',
|
|
134
|
+
'inputValue': 'logical',
|
|
135
|
+
'expect': true
|
|
135
136
|
},
|
|
136
137
|
...defaultItemss({
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
'string \'hello\'': true,
|
|
139
|
+
'empty string': false
|
|
139
140
|
})
|
|
140
141
|
]
|
|
141
142
|
},
|
|
142
143
|
{
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
'name': 'Wrong expression for string: string(,5)',
|
|
145
|
+
'rule': 'string(,5)',
|
|
146
|
+
'items': [
|
|
146
147
|
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
'inputName': 'string \'any\'',
|
|
149
|
+
'inputValue': 'any',
|
|
150
|
+
'expect': 'throw'
|
|
150
151
|
}
|
|
151
152
|
]
|
|
152
153
|
},
|
|
153
154
|
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
'name': 'Wrong expression for string: string(,)',
|
|
156
|
+
'rule': 'string(,)',
|
|
157
|
+
'items': [
|
|
157
158
|
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
'inputName': 'string \'any\'',
|
|
160
|
+
'inputValue': 'any',
|
|
161
|
+
'expect': 'throw'
|
|
161
162
|
}
|
|
162
163
|
]
|
|
163
164
|
},
|
|
164
165
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
'name': 'String contains only ASCII characters.',
|
|
167
|
+
'rule': 'ascii_string',
|
|
168
|
+
'items': [
|
|
168
169
|
{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
'inputName': 'string \'world\'',
|
|
171
|
+
'inputValue': 'world',
|
|
172
|
+
'expect': true
|
|
172
173
|
},
|
|
173
174
|
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
'inputName': 'string \'hi\'',
|
|
176
|
+
'inputValue': 'hi',
|
|
177
|
+
'expect': true
|
|
177
178
|
},
|
|
178
179
|
{
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
'inputName': 'string \'proper\'',
|
|
181
|
+
'inputValue': 'proper',
|
|
182
|
+
'expect': true
|
|
182
183
|
},
|
|
183
184
|
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
'inputName': 'string \'logical\'',
|
|
186
|
+
'inputValue': 'logical',
|
|
187
|
+
'expect': true
|
|
187
188
|
},
|
|
188
189
|
...defaultItemss({
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
'string \'hello\'': true,
|
|
191
|
+
'empty string': true
|
|
191
192
|
})
|
|
192
193
|
]
|
|
193
194
|
},
|
|
194
195
|
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
'name': 'String contains 2 ~ 6 characters',
|
|
197
|
+
'rule': 'string(2, 6)',
|
|
198
|
+
'items': [
|
|
198
199
|
{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
'inputName': 'string \'world\'',
|
|
201
|
+
'inputValue': 'world',
|
|
202
|
+
'expect': true
|
|
202
203
|
},
|
|
203
204
|
{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
'inputName': 'string \'hi\'',
|
|
206
|
+
'inputValue': 'hi',
|
|
207
|
+
'expect': true
|
|
207
208
|
},
|
|
208
209
|
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
'inputName': 'string \'proper\'',
|
|
211
|
+
'inputValue': 'proper',
|
|
212
|
+
'expect': true
|
|
212
213
|
},
|
|
213
214
|
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
'inputName': 'string \'logical\'',
|
|
216
|
+
'inputValue': 'logical',
|
|
217
|
+
'expect': false
|
|
217
218
|
},
|
|
218
219
|
...defaultItemss({
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
'string \'hello\'': true,
|
|
221
|
+
'empty string': false
|
|
221
222
|
})
|
|
222
223
|
]
|
|
223
224
|
},
|
|
224
225
|
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
226
|
+
'name': 'String contains only 2 ~ 6 latin characters.',
|
|
227
|
+
'rule': 'latin_string(2, 6)',
|
|
228
|
+
'items': [
|
|
229
|
+
{
|
|
230
|
+
'inputName': 'string \'ⱠⱡⱢab\'',
|
|
231
|
+
'inputValue': 'ⱠⱡⱢab',
|
|
232
|
+
'expect': true
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
'inputName': 'string \'Ᵽ\'',
|
|
236
|
+
'inputValue': 'Ᵽ',
|
|
237
|
+
'expect': false
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
'inputName': 'string \'proper\'',
|
|
241
|
+
'inputValue': 'proper',
|
|
242
|
+
'expect': true
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
'inputName': 'string \'logical\'',
|
|
246
|
+
'inputValue': 'logical',
|
|
247
|
+
'expect': false
|
|
248
|
+
},
|
|
249
|
+
...defaultItemss({
|
|
250
|
+
'string \'hello\'': true,
|
|
251
|
+
'empty string': false
|
|
252
|
+
})
|
|
253
|
+
]
|
|
253
254
|
},
|
|
254
255
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
'name': 'String contains 2 ~ 6 ASCII characters.',
|
|
257
|
+
'rule': 'ascii_string(2, 6)',
|
|
258
|
+
'items': [
|
|
258
259
|
{
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
'inputName': 'string \'proper\'',
|
|
261
|
+
'inputValue': 'proper',
|
|
262
|
+
'expect': true
|
|
262
263
|
},
|
|
263
264
|
{
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
'inputName': 'string \'world\'',
|
|
266
|
+
'inputValue': 'world',
|
|
267
|
+
'expect': true
|
|
267
268
|
},
|
|
268
269
|
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
'inputName': 'string \'logical\'',
|
|
271
|
+
'inputValue': 'logical',
|
|
272
|
+
'expect': false
|
|
272
273
|
},
|
|
273
274
|
{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
'inputName': 'string \'ⱠⱡⱢab\'',
|
|
276
|
+
'inputValue': 'ⱠⱡⱢab',
|
|
277
|
+
'expect': false
|
|
277
278
|
},
|
|
278
279
|
{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
'inputName': 'string \'Ᵽ\'',
|
|
281
|
+
'inputValue': 'Ᵽ',
|
|
282
|
+
'expect': false
|
|
282
283
|
},
|
|
283
284
|
...defaultItemss({
|
|
284
|
-
|
|
285
|
-
|
|
285
|
+
'string \'hello\'': true,
|
|
286
|
+
'empty string': false
|
|
286
287
|
})
|
|
287
288
|
]
|
|
288
289
|
},
|
|
289
290
|
{
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
'name': 'String contains 2 ~ 8 HEX characters.',
|
|
292
|
+
'rule': 'hex_string(2, 8)',
|
|
293
|
+
'items': [
|
|
293
294
|
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
'inputName': 'string \'fffff\'',
|
|
296
|
+
'inputValue': 'fffff',
|
|
297
|
+
'expect': true
|
|
297
298
|
},
|
|
298
299
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
'inputName': 'string \'1234a\'',
|
|
301
|
+
'inputValue': '1234a',
|
|
302
|
+
'expect': true
|
|
302
303
|
},
|
|
303
304
|
{
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
'inputName': 'string \'fffffffffffff\'',
|
|
306
|
+
'inputValue': 'fffffffffffff',
|
|
307
|
+
'expect': false
|
|
307
308
|
},
|
|
308
309
|
{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
'inputName': 'string \'logical\'',
|
|
311
|
+
'inputValue': 'logical',
|
|
312
|
+
'expect': false
|
|
312
313
|
},
|
|
313
314
|
{
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
'inputName': 'string \'ⱠⱡⱢab\'',
|
|
316
|
+
'inputValue': 'ⱠⱡⱢab',
|
|
317
|
+
'expect': false
|
|
317
318
|
},
|
|
318
319
|
{
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
'inputName': 'string \'Ᵽ\'',
|
|
321
|
+
'inputValue': 'Ᵽ',
|
|
322
|
+
'expect': false
|
|
322
323
|
},
|
|
323
324
|
...defaultItemss({
|
|
324
|
-
|
|
325
|
-
|
|
325
|
+
'string \'hello\'': false,
|
|
326
|
+
'empty string': false
|
|
326
327
|
})
|
|
327
328
|
]
|
|
328
329
|
},
|
|
329
330
|
{
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
'name': 'Boolean',
|
|
332
|
+
'rule': 'boolean',
|
|
333
|
+
'items': [
|
|
333
334
|
{
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
'inputName': 'string \'true\'',
|
|
336
|
+
'inputValue': 'true',
|
|
337
|
+
'expect': false
|
|
337
338
|
},
|
|
338
339
|
{
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
'inputName': 'string \'false\'',
|
|
341
|
+
'inputValue': 'false',
|
|
342
|
+
'expect': false
|
|
342
343
|
},
|
|
343
344
|
...defaultItemss({
|
|
344
|
-
|
|
345
|
-
|
|
345
|
+
'true': true,
|
|
346
|
+
'false': true
|
|
346
347
|
})
|
|
347
348
|
]
|
|
348
349
|
},
|
|
349
350
|
{
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
'name': 'True',
|
|
352
|
+
'rule': 'true',
|
|
353
|
+
'items': [
|
|
353
354
|
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
'inputName': 'string \'true\'',
|
|
356
|
+
'inputValue': 'true',
|
|
357
|
+
'expect': false
|
|
357
358
|
},
|
|
358
359
|
...defaultItemss({
|
|
359
|
-
|
|
360
|
-
|
|
360
|
+
'true': true,
|
|
361
|
+
'false': false
|
|
361
362
|
})
|
|
362
363
|
]
|
|
363
364
|
},
|
|
364
365
|
{
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
'name': 'False',
|
|
367
|
+
'rule': 'false',
|
|
368
|
+
'items': [
|
|
368
369
|
{
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
'inputName': 'string \'false\'',
|
|
371
|
+
'inputValue': 'false',
|
|
372
|
+
'expect': false
|
|
372
373
|
},
|
|
373
374
|
...defaultItemss({
|
|
374
|
-
|
|
375
|
-
|
|
375
|
+
'true': false,
|
|
376
|
+
'false': true
|
|
376
377
|
})
|
|
377
378
|
]
|
|
378
379
|
},
|
|
379
380
|
{
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
'name': 'Logically true value',
|
|
382
|
+
'rule': 'true_value',
|
|
383
|
+
'items': [
|
|
383
384
|
{
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
'inputName': 'string \'true\'',
|
|
386
|
+
'inputValue': 'true',
|
|
387
|
+
'expect': true
|
|
387
388
|
},
|
|
388
389
|
...defaultItemss({
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
390
|
+
'true': true,
|
|
391
|
+
'false': false,
|
|
392
|
+
'object': true,
|
|
393
|
+
'number 1': true,
|
|
394
|
+
'string \'hello\'': true,
|
|
395
|
+
'empty array': true
|
|
395
396
|
})
|
|
396
397
|
]
|
|
397
398
|
},
|
|
398
399
|
{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
'name': 'Logically false value',
|
|
401
|
+
'rule': 'false_value',
|
|
402
|
+
'items': [
|
|
402
403
|
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
404
|
+
'inputName': 'string \'false\'',
|
|
405
|
+
'inputValue': 'false',
|
|
406
|
+
'expect': false
|
|
406
407
|
},
|
|
407
408
|
...defaultItemss({
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
409
|
+
'true': false,
|
|
410
|
+
'false': true,
|
|
411
|
+
'number 0': true,
|
|
412
|
+
'null': true,
|
|
413
|
+
'undefined': true,
|
|
414
|
+
'empty string': true
|
|
414
415
|
})
|
|
415
416
|
]
|
|
416
417
|
},
|
|
417
418
|
{
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
'name': 'Integer',
|
|
420
|
+
'rule': 'int',
|
|
421
|
+
'items': [
|
|
421
422
|
{
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
423
|
+
'inputName': 'number -1',
|
|
424
|
+
'inputValue': -1,
|
|
425
|
+
'expect': true
|
|
425
426
|
},
|
|
426
427
|
{
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
'inputName': 'number 1.23',
|
|
429
|
+
'inputValue': 1.23,
|
|
430
|
+
'expect': false
|
|
430
431
|
},
|
|
431
432
|
...defaultItemss({
|
|
432
|
-
|
|
433
|
-
|
|
433
|
+
'number 0': true,
|
|
434
|
+
'number 1': true
|
|
434
435
|
})
|
|
435
436
|
]
|
|
436
437
|
},
|
|
437
438
|
{
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
439
|
+
'name': 'Wrong expression for integer: int(,)',
|
|
440
|
+
'rule': 'int(,)',
|
|
441
|
+
'items': [
|
|
441
442
|
{
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
'inputName': 'any',
|
|
444
|
+
'inputValue': 'any',
|
|
445
|
+
'expect': 'throw'
|
|
445
446
|
}
|
|
446
447
|
]
|
|
447
448
|
},
|
|
448
449
|
{
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
'name': 'Integer >= 10',
|
|
451
|
+
'rule': 'int(10,)',
|
|
452
|
+
'items': [
|
|
452
453
|
{
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
454
|
+
'inputName': 'number 11',
|
|
455
|
+
'inputValue': 11,
|
|
456
|
+
'expect': true
|
|
456
457
|
},
|
|
457
458
|
{
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
'inputName': 'number 10',
|
|
460
|
+
'inputValue': 10,
|
|
461
|
+
'expect': true
|
|
461
462
|
},
|
|
462
463
|
{
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
464
|
+
'inputName': 'number -1',
|
|
465
|
+
'inputValue': -1,
|
|
466
|
+
'expect': false
|
|
466
467
|
},
|
|
467
468
|
{
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
'inputName': 'number 9',
|
|
470
|
+
'inputValue': 9,
|
|
471
|
+
'expect': false
|
|
471
472
|
},
|
|
472
473
|
{
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
'inputName': 'number 1.23',
|
|
475
|
+
'inputValue': 1.23,
|
|
476
|
+
'expect': false
|
|
476
477
|
},
|
|
477
478
|
...defaultItemss({
|
|
478
|
-
|
|
479
|
-
|
|
479
|
+
'number 0': false,
|
|
480
|
+
'number 1': false
|
|
480
481
|
})
|
|
481
482
|
]
|
|
482
483
|
},
|
|
483
484
|
{
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
'name': 'Integer <= 10',
|
|
486
|
+
'rule': 'int(,10)',
|
|
487
|
+
'items': [
|
|
487
488
|
{
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
'inputName': 'number 11',
|
|
490
|
+
'inputValue': 11,
|
|
491
|
+
'expect': false
|
|
491
492
|
},
|
|
492
493
|
{
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
494
|
+
'inputName': 'number 10',
|
|
495
|
+
'inputValue': 10,
|
|
496
|
+
'expect': true
|
|
496
497
|
},
|
|
497
498
|
{
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
499
|
+
'inputName': 'number -1',
|
|
500
|
+
'inputValue': -1,
|
|
501
|
+
'expect': true
|
|
501
502
|
},
|
|
502
503
|
{
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
'inputName': 'number 9',
|
|
505
|
+
'inputValue': 9,
|
|
506
|
+
'expect': true
|
|
506
507
|
},
|
|
507
508
|
{
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
509
|
+
'inputName': 'number 1.23',
|
|
510
|
+
'inputValue': 1.23,
|
|
511
|
+
'expect': false
|
|
511
512
|
},
|
|
512
513
|
...defaultItemss({
|
|
513
|
-
|
|
514
|
-
|
|
514
|
+
'number 0': true,
|
|
515
|
+
'number 1': true
|
|
515
516
|
})
|
|
516
517
|
]
|
|
517
518
|
},
|
|
518
519
|
{
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
520
|
+
'name': 'Integer between -12 and 25',
|
|
521
|
+
'rule': 'int(-12, 25)',
|
|
522
|
+
'items': [
|
|
522
523
|
{
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
524
|
+
'inputName': 'number -1',
|
|
525
|
+
'inputValue': -1,
|
|
526
|
+
'expect': true
|
|
526
527
|
},
|
|
527
528
|
{
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
529
|
+
'inputName': 'number -12',
|
|
530
|
+
'inputValue': -12,
|
|
531
|
+
'expect': true
|
|
531
532
|
},
|
|
532
533
|
{
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
534
|
+
'inputName': 'number 25',
|
|
535
|
+
'inputValue': 25,
|
|
536
|
+
'expect': true
|
|
536
537
|
},
|
|
537
538
|
{
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
'inputName': 'number 26',
|
|
540
|
+
'inputValue': 26,
|
|
541
|
+
'expect': false
|
|
541
542
|
},
|
|
542
543
|
{
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
'inputName': 'number -13',
|
|
545
|
+
'inputValue': -13,
|
|
546
|
+
'expect': false
|
|
546
547
|
},
|
|
547
548
|
{
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
549
|
+
'inputName': 'number -11.5',
|
|
550
|
+
'inputValue': -11.5,
|
|
551
|
+
'expect': false
|
|
551
552
|
},
|
|
552
553
|
{
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
554
|
+
'inputName': 'number 1.23',
|
|
555
|
+
'inputValue': 1.23,
|
|
556
|
+
'expect': false
|
|
556
557
|
},
|
|
557
558
|
...defaultItemss({
|
|
558
|
-
|
|
559
|
-
|
|
559
|
+
'number 0': true,
|
|
560
|
+
'number 1': true
|
|
560
561
|
})
|
|
561
562
|
]
|
|
562
563
|
},
|
|
563
564
|
{
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
565
|
+
'name': 'Integer between -0x80 and 0x7F',
|
|
566
|
+
'rule': 'int8',
|
|
567
|
+
'items': [
|
|
567
568
|
{
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
'inputName': 'number -1',
|
|
570
|
+
'inputValue': -1,
|
|
571
|
+
'expect': true
|
|
571
572
|
},
|
|
572
573
|
{
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
'inputName': 'number -0x80',
|
|
575
|
+
'inputValue': -0x80,
|
|
576
|
+
'expect': true
|
|
576
577
|
},
|
|
577
578
|
{
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
579
|
+
'inputName': 'number 0x7F',
|
|
580
|
+
'inputValue': 0x7F,
|
|
581
|
+
'expect': true
|
|
581
582
|
},
|
|
582
583
|
{
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
584
|
+
'inputName': 'number 0x80',
|
|
585
|
+
'inputValue': 0x80,
|
|
586
|
+
'expect': false
|
|
586
587
|
},
|
|
587
588
|
{
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
589
|
+
'inputName': 'number -0x81',
|
|
590
|
+
'inputValue': -0x81,
|
|
591
|
+
'expect': false
|
|
591
592
|
},
|
|
592
593
|
{
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
594
|
+
'inputName': 'number 1.23',
|
|
595
|
+
'inputValue': 1.23,
|
|
596
|
+
'expect': false
|
|
596
597
|
},
|
|
597
598
|
{
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
599
|
+
'inputName': 'number -1.23',
|
|
600
|
+
'inputValue': -1.23,
|
|
601
|
+
'expect': false
|
|
601
602
|
},
|
|
602
603
|
...defaultItemss({
|
|
603
|
-
|
|
604
|
-
|
|
604
|
+
'number 0': true,
|
|
605
|
+
'number 1': true
|
|
605
606
|
})
|
|
606
607
|
]
|
|
607
608
|
},
|
|
608
609
|
{
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
'name': 'Integer between -0x8000 and 0x7FFF',
|
|
611
|
+
'rule': 'int16',
|
|
612
|
+
'items': [
|
|
612
613
|
{
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
614
|
+
'inputName': 'number -1',
|
|
615
|
+
'inputValue': -1,
|
|
616
|
+
'expect': true
|
|
616
617
|
},
|
|
617
618
|
{
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
619
|
+
'inputName': 'number -0x8000',
|
|
620
|
+
'inputValue': -0x8000,
|
|
621
|
+
'expect': true
|
|
621
622
|
},
|
|
622
623
|
{
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
624
|
+
'inputName': 'number 0x7FFF',
|
|
625
|
+
'inputValue': 0x7FFF,
|
|
626
|
+
'expect': true
|
|
626
627
|
},
|
|
627
628
|
{
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
'inputName': 'number 0x8000',
|
|
630
|
+
'inputValue': 0x8000,
|
|
631
|
+
'expect': false
|
|
631
632
|
},
|
|
632
633
|
{
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
634
|
+
'inputName': 'number -0x8001',
|
|
635
|
+
'inputValue': -0x8001,
|
|
636
|
+
'expect': false
|
|
636
637
|
},
|
|
637
638
|
{
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
639
|
+
'inputName': 'number 1.23',
|
|
640
|
+
'inputValue': 1.23,
|
|
641
|
+
'expect': false
|
|
641
642
|
},
|
|
642
643
|
{
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
644
|
+
'inputName': 'number -1.23',
|
|
645
|
+
'inputValue': -1.23,
|
|
646
|
+
'expect': false
|
|
646
647
|
},
|
|
647
648
|
...defaultItemss({
|
|
648
|
-
|
|
649
|
-
|
|
649
|
+
'number 0': true,
|
|
650
|
+
'number 1': true
|
|
650
651
|
})
|
|
651
652
|
]
|
|
652
653
|
},
|
|
653
654
|
{
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
655
|
+
'name': 'Integer between -0x80000000 and 0x7FFFFFFF',
|
|
656
|
+
'rule': 'int32',
|
|
657
|
+
'items': [
|
|
657
658
|
{
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
659
|
+
'inputName': 'number -1',
|
|
660
|
+
'inputValue': -1,
|
|
661
|
+
'expect': true
|
|
661
662
|
},
|
|
662
663
|
{
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
664
|
+
'inputName': 'number -0x80000000',
|
|
665
|
+
'inputValue': -0x80000000,
|
|
666
|
+
'expect': true
|
|
666
667
|
},
|
|
667
668
|
{
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
669
|
+
'inputName': 'number 0x7FFFFFFF',
|
|
670
|
+
'inputValue': 0x7FFFFFFF,
|
|
671
|
+
'expect': true
|
|
671
672
|
},
|
|
672
673
|
{
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
674
|
+
'inputName': 'number 0x80000000',
|
|
675
|
+
'inputValue': 0x80000000,
|
|
676
|
+
'expect': false
|
|
676
677
|
},
|
|
677
678
|
{
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
679
|
+
'inputName': 'number -0x80000001',
|
|
680
|
+
'inputValue': -0x80000001,
|
|
681
|
+
'expect': false
|
|
681
682
|
},
|
|
682
683
|
{
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
684
|
+
'inputName': 'number 1.23',
|
|
685
|
+
'inputValue': 1.23,
|
|
686
|
+
'expect': false
|
|
686
687
|
},
|
|
687
688
|
{
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
689
|
+
'inputName': 'number -1.23',
|
|
690
|
+
'inputValue': -1.23,
|
|
691
|
+
'expect': false
|
|
691
692
|
},
|
|
692
693
|
...defaultItemss({
|
|
693
|
-
|
|
694
|
-
|
|
694
|
+
'number 0': true,
|
|
695
|
+
'number 1': true
|
|
695
696
|
})
|
|
696
697
|
]
|
|
697
698
|
},
|
|
698
699
|
{
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
700
|
+
'name': '64-bits integer',
|
|
701
|
+
'rule': 'int64',
|
|
702
|
+
'items': [
|
|
702
703
|
{
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
704
|
+
'inputName': 'number -1',
|
|
705
|
+
'inputValue': -1,
|
|
706
|
+
'expect': true
|
|
706
707
|
},
|
|
707
708
|
{
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
709
|
+
'inputName': 'number -0x8000000000000000',
|
|
710
|
+
'inputValue': -0x8000000000000000,
|
|
711
|
+
'expect': true
|
|
711
712
|
},
|
|
712
713
|
{
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
714
|
+
'inputName': 'number 0x7FFFFFFF',
|
|
715
|
+
'inputValue': 0x7FFFFFFF,
|
|
716
|
+
'expect': true
|
|
716
717
|
},
|
|
717
718
|
{
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
719
|
+
'inputName': 'number 0x7FFFFFFFFFFFFFFF',
|
|
720
|
+
'inputValue': 0x7FFFFFFFFFFFFFFF,
|
|
721
|
+
'expect': true
|
|
721
722
|
},
|
|
722
723
|
{
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
724
|
+
'inputName': 'number 1.23',
|
|
725
|
+
'inputValue': 1.23,
|
|
726
|
+
'expect': false
|
|
726
727
|
},
|
|
727
728
|
{
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
729
|
+
'inputName': 'number -1.23',
|
|
730
|
+
'inputValue': -1.23,
|
|
731
|
+
'expect': false
|
|
731
732
|
},
|
|
732
733
|
...defaultItemss({
|
|
733
|
-
|
|
734
|
-
|
|
734
|
+
'number 0': true,
|
|
735
|
+
'number 1': true
|
|
735
736
|
})
|
|
736
737
|
]
|
|
737
738
|
},
|
|
738
739
|
{
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
740
|
+
'name': 'Integer larger than -1',
|
|
741
|
+
'rule': 'uint',
|
|
742
|
+
'items': [
|
|
742
743
|
{
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
744
|
+
'inputName': 'number -1',
|
|
745
|
+
'inputValue': -1,
|
|
746
|
+
'expect': false
|
|
746
747
|
},
|
|
747
748
|
{
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
749
|
+
'inputName': 'number 1.23',
|
|
750
|
+
'inputValue': 1.23,
|
|
751
|
+
'expect': false
|
|
751
752
|
},
|
|
752
753
|
...defaultItemss({
|
|
753
|
-
|
|
754
|
-
|
|
754
|
+
'number 0': true,
|
|
755
|
+
'number 1': true
|
|
755
756
|
})
|
|
756
757
|
]
|
|
757
758
|
},
|
|
758
759
|
{
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
760
|
+
'name': 'Integer between 0 and 0xFF',
|
|
761
|
+
'rule': 'uint8',
|
|
762
|
+
'items': [
|
|
762
763
|
{
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
764
|
+
'inputName': 'number -1',
|
|
765
|
+
'inputValue': -1,
|
|
766
|
+
'expect': false
|
|
766
767
|
},
|
|
767
768
|
{
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
769
|
+
'inputName': 'number 0xFF',
|
|
770
|
+
'inputValue': 0xFF,
|
|
771
|
+
'expect': true
|
|
771
772
|
},
|
|
772
773
|
{
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
774
|
+
'inputName': 'number 0x100',
|
|
775
|
+
'inputValue': 0x100,
|
|
776
|
+
'expect': false
|
|
776
777
|
},
|
|
777
778
|
{
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
'inputName': 'number 1.23',
|
|
780
|
+
'inputValue': 1.23,
|
|
781
|
+
'expect': false
|
|
781
782
|
},
|
|
782
783
|
{
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
784
|
+
'inputName': 'number -1.23',
|
|
785
|
+
'inputValue': -1.23,
|
|
786
|
+
'expect': false
|
|
786
787
|
},
|
|
787
788
|
...defaultItemss({
|
|
788
|
-
|
|
789
|
-
|
|
789
|
+
'number 0': true,
|
|
790
|
+
'number 1': true
|
|
790
791
|
})
|
|
791
792
|
]
|
|
792
793
|
},
|
|
793
794
|
{
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
'name': 'Integer between 0 and 0xFFFF',
|
|
796
|
+
'rule': 'uint16',
|
|
797
|
+
'items': [
|
|
797
798
|
{
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
799
|
+
'inputName': 'number -1',
|
|
800
|
+
'inputValue': -1,
|
|
801
|
+
'expect': false
|
|
801
802
|
},
|
|
802
803
|
{
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
804
|
+
'inputName': 'number 0xFFFF',
|
|
805
|
+
'inputValue': 0xFFFF,
|
|
806
|
+
'expect': true
|
|
806
807
|
},
|
|
807
808
|
{
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
809
|
+
'inputName': 'number 0x10000',
|
|
810
|
+
'inputValue': 0x10000,
|
|
811
|
+
'expect': false
|
|
811
812
|
},
|
|
812
813
|
{
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
814
|
+
'inputName': 'number 1.23',
|
|
815
|
+
'inputValue': 1.23,
|
|
816
|
+
'expect': false
|
|
816
817
|
},
|
|
817
818
|
{
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
819
|
+
'inputName': 'number -1.23',
|
|
820
|
+
'inputValue': -1.23,
|
|
821
|
+
'expect': false
|
|
821
822
|
},
|
|
822
823
|
...defaultItemss({
|
|
823
|
-
|
|
824
|
-
|
|
824
|
+
'number 0': true,
|
|
825
|
+
'number 1': true
|
|
825
826
|
})
|
|
826
827
|
]
|
|
827
828
|
},
|
|
828
829
|
{
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
'name': 'Integer between 0 and 0xFFFFFFFF',
|
|
831
|
+
'rule': 'uint32',
|
|
832
|
+
'items': [
|
|
832
833
|
{
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
834
|
+
'inputName': 'number -1',
|
|
835
|
+
'inputValue': -1,
|
|
836
|
+
'expect': false
|
|
836
837
|
},
|
|
837
838
|
{
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
839
|
+
'inputName': 'number 0xFFFFFFFF',
|
|
840
|
+
'inputValue': 0xFFFFFFFF,
|
|
841
|
+
'expect': true
|
|
841
842
|
},
|
|
842
843
|
{
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
844
|
+
'inputName': 'number 0x100000000',
|
|
845
|
+
'inputValue': 0x100000000,
|
|
846
|
+
'expect': false
|
|
846
847
|
},
|
|
847
848
|
{
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
849
|
+
'inputName': 'number 1.23',
|
|
850
|
+
'inputValue': 1.23,
|
|
851
|
+
'expect': false
|
|
851
852
|
},
|
|
852
853
|
{
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
854
|
+
'inputName': 'number -1.23',
|
|
855
|
+
'inputValue': -1.23,
|
|
856
|
+
'expect': false
|
|
856
857
|
},
|
|
857
858
|
...defaultItemss({
|
|
858
|
-
|
|
859
|
-
|
|
859
|
+
'number 0': true,
|
|
860
|
+
'number 1': true
|
|
860
861
|
})
|
|
861
862
|
]
|
|
862
863
|
},
|
|
863
864
|
{
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
865
|
+
'name': 'Integer between 0 and 0xFFFFFFFFFFFFFFFF',
|
|
866
|
+
'rule': 'uint64',
|
|
867
|
+
'items': [
|
|
867
868
|
{
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
869
|
+
'inputName': 'number -1',
|
|
870
|
+
'inputValue': -1,
|
|
871
|
+
'expect': false
|
|
871
872
|
},
|
|
872
873
|
{
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
874
|
+
'inputName': 'number 0xFFFFFFFFFFFFFFFF',
|
|
875
|
+
'inputValue': 0xFFFFFFFFFFFFFFFF,
|
|
876
|
+
'expect': true
|
|
876
877
|
},
|
|
877
878
|
{
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
879
|
+
'inputName': 'number 0x7FFFFFFF',
|
|
880
|
+
'inputValue': 0x7FFFFFFF,
|
|
881
|
+
'expect': true
|
|
881
882
|
},
|
|
882
883
|
{
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
884
|
+
'inputName': 'number 1.23',
|
|
885
|
+
'inputValue': 1.23,
|
|
886
|
+
'expect': false
|
|
886
887
|
},
|
|
887
888
|
{
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
889
|
+
'inputName': 'number -1.23',
|
|
890
|
+
'inputValue': -1.23,
|
|
891
|
+
'expect': false
|
|
891
892
|
},
|
|
892
893
|
...defaultItemss({
|
|
893
|
-
|
|
894
|
-
|
|
894
|
+
'number 0': true,
|
|
895
|
+
'number 1': true
|
|
895
896
|
})
|
|
896
897
|
]
|
|
897
898
|
},
|
|
898
899
|
{
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
900
|
+
'name': 'Accuracy safe integer',
|
|
901
|
+
'rule': 'safe_int',
|
|
902
|
+
'items': [
|
|
902
903
|
{
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
904
|
+
'inputName': 'number -1',
|
|
905
|
+
'inputValue': -1,
|
|
906
|
+
'expect': true
|
|
906
907
|
},
|
|
907
908
|
{
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
909
|
+
'inputName': 'number 9007199254740991',
|
|
910
|
+
'inputValue': 9007199254740991,
|
|
911
|
+
'expect': true
|
|
911
912
|
},
|
|
912
913
|
{
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
914
|
+
'inputName': 'number -9007199254740991',
|
|
915
|
+
'inputValue': -9007199254740991,
|
|
916
|
+
'expect': true
|
|
916
917
|
},
|
|
917
918
|
{
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
919
|
+
'inputName': 'number 9007199254740992',
|
|
920
|
+
'inputValue': 9007199254740992,
|
|
921
|
+
'expect': false
|
|
921
922
|
},
|
|
922
923
|
{
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
924
|
+
'inputName': 'number -9007199254740992',
|
|
925
|
+
'inputValue': -9007199254740992,
|
|
926
|
+
'expect': false
|
|
926
927
|
},
|
|
927
928
|
{
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
929
|
+
'inputName': 'number 1.23',
|
|
930
|
+
'inputValue': 1.23,
|
|
931
|
+
'expect': false
|
|
931
932
|
},
|
|
932
933
|
{
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
934
|
+
'inputName': 'number -1.23',
|
|
935
|
+
'inputValue': -1.23,
|
|
936
|
+
'expect': false
|
|
936
937
|
},
|
|
937
938
|
...defaultItemss({
|
|
938
|
-
|
|
939
|
-
|
|
939
|
+
'number 0': true,
|
|
940
|
+
'number 1': true
|
|
940
941
|
})
|
|
941
942
|
]
|
|
942
943
|
},
|
|
943
944
|
{
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
945
|
+
'name': 'Accuracy safe unsigned integer',
|
|
946
|
+
'rule': 'safe_uint',
|
|
947
|
+
'items': [
|
|
947
948
|
{
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
949
|
+
'inputName': 'number -1',
|
|
950
|
+
'inputValue': -1,
|
|
951
|
+
'expect': false
|
|
951
952
|
},
|
|
952
953
|
{
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
954
|
+
'inputName': 'number 9007199254740991',
|
|
955
|
+
'inputValue': 9007199254740991,
|
|
956
|
+
'expect': true
|
|
956
957
|
},
|
|
957
958
|
{
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
959
|
+
'inputName': 'number 9007199254740992',
|
|
960
|
+
'inputValue': 9007199254740992,
|
|
961
|
+
'expect': false
|
|
961
962
|
},
|
|
962
963
|
{
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
964
|
+
'inputName': 'number 1.23',
|
|
965
|
+
'inputValue': 1.23,
|
|
966
|
+
'expect': false
|
|
966
967
|
},
|
|
967
968
|
{
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
969
|
+
'inputName': 'number -1.23',
|
|
970
|
+
'inputValue': -1.23,
|
|
971
|
+
'expect': false
|
|
971
972
|
},
|
|
972
973
|
...defaultItemss({
|
|
973
|
-
|
|
974
|
-
|
|
974
|
+
'number 0': true,
|
|
975
|
+
'number 1': true
|
|
975
976
|
})
|
|
976
977
|
]
|
|
977
978
|
},
|
|
978
979
|
{
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
980
|
+
'name': 'Float number',
|
|
981
|
+
'rule': 'float',
|
|
982
|
+
'items': [
|
|
982
983
|
{
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
984
|
+
'inputName': 'number -1',
|
|
985
|
+
'inputValue': -1,
|
|
986
|
+
'expect': true
|
|
986
987
|
},
|
|
987
988
|
{
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
989
|
+
'inputName': 'number 120312',
|
|
990
|
+
'inputValue': 120312,
|
|
991
|
+
'expect': true
|
|
991
992
|
},
|
|
992
993
|
{
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
994
|
+
'inputName': 'number 1.23',
|
|
995
|
+
'inputValue': 1.23,
|
|
996
|
+
'expect': true
|
|
996
997
|
},
|
|
997
998
|
{
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
999
|
+
'inputName': 'number -1.23',
|
|
1000
|
+
'inputValue': -1.23,
|
|
1001
|
+
'expect': true
|
|
1001
1002
|
},
|
|
1002
1003
|
...defaultItemss({
|
|
1003
|
-
|
|
1004
|
-
|
|
1004
|
+
'number 0': true,
|
|
1005
|
+
'number 1': true
|
|
1005
1006
|
})
|
|
1006
1007
|
]
|
|
1007
1008
|
},
|
|
1008
1009
|
{
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1010
|
+
'name': 'Unsigned float number',
|
|
1011
|
+
'rule': 'ufloat',
|
|
1012
|
+
'items': [
|
|
1012
1013
|
{
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1014
|
+
'inputName': 'number -1',
|
|
1015
|
+
'inputValue': -1,
|
|
1016
|
+
'expect': false
|
|
1016
1017
|
},
|
|
1017
1018
|
{
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1019
|
+
'inputName': 'number 120312',
|
|
1020
|
+
'inputValue': 120312,
|
|
1021
|
+
'expect': true
|
|
1021
1022
|
},
|
|
1022
1023
|
{
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1024
|
+
'inputName': 'number 1.23',
|
|
1025
|
+
'inputValue': 1.23,
|
|
1026
|
+
'expect': true
|
|
1026
1027
|
},
|
|
1027
1028
|
{
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1029
|
+
'inputName': 'number -1.23',
|
|
1030
|
+
'inputValue': -1.23,
|
|
1031
|
+
'expect': false
|
|
1031
1032
|
},
|
|
1032
1033
|
...defaultItemss({
|
|
1033
|
-
|
|
1034
|
-
|
|
1034
|
+
'number 0': true,
|
|
1035
|
+
'number 1': true
|
|
1035
1036
|
})
|
|
1036
1037
|
]
|
|
1037
1038
|
},
|
|
1038
1039
|
{
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1040
|
+
'name': 'Number',
|
|
1041
|
+
'rule': 'number',
|
|
1042
|
+
'items': [
|
|
1042
1043
|
{
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1044
|
+
'inputName': 'number -1',
|
|
1045
|
+
'inputValue': -1,
|
|
1046
|
+
'expect': true
|
|
1046
1047
|
},
|
|
1047
1048
|
{
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1049
|
+
'inputName': 'number 120312',
|
|
1050
|
+
'inputValue': 120312,
|
|
1051
|
+
'expect': true
|
|
1051
1052
|
},
|
|
1052
1053
|
{
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
'inputName': 'number 1.23',
|
|
1055
|
+
'inputValue': 1.23,
|
|
1056
|
+
'expect': true
|
|
1056
1057
|
},
|
|
1057
1058
|
{
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1059
|
+
'inputName': 'number -1.23',
|
|
1060
|
+
'inputValue': -1.23,
|
|
1061
|
+
'expect': true
|
|
1061
1062
|
},
|
|
1062
1063
|
...defaultItemss({
|
|
1063
|
-
|
|
1064
|
-
|
|
1064
|
+
'number 0': true,
|
|
1065
|
+
'number 1': true
|
|
1065
1066
|
})
|
|
1066
1067
|
]
|
|
1067
1068
|
},
|
|
1068
1069
|
{
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1070
|
+
'name': 'Number between 1.0, 10.0',
|
|
1071
|
+
'rule': 'number(1.0, 10.0)',
|
|
1072
|
+
'items': [
|
|
1072
1073
|
{
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1074
|
+
'inputName': 'number -1',
|
|
1075
|
+
'inputValue': -1,
|
|
1076
|
+
'expect': false
|
|
1076
1077
|
},
|
|
1077
1078
|
{
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1079
|
+
'inputName': 'number 1',
|
|
1080
|
+
'inputValue': 1,
|
|
1081
|
+
'expect': true
|
|
1081
1082
|
},
|
|
1082
1083
|
{
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1084
|
+
'inputName': 'number 10',
|
|
1085
|
+
'inputValue': 10,
|
|
1086
|
+
'expect': true
|
|
1086
1087
|
},
|
|
1087
1088
|
{
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1089
|
+
'inputName': 'number 11',
|
|
1090
|
+
'inputValue': 11,
|
|
1091
|
+
'expect': false
|
|
1091
1092
|
},
|
|
1092
1093
|
{
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1094
|
+
'inputName': 'number 0',
|
|
1095
|
+
'inputValue': 0,
|
|
1096
|
+
'expect': false
|
|
1096
1097
|
},
|
|
1097
1098
|
{
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1099
|
+
'inputName': 'number 1.23',
|
|
1100
|
+
'inputValue': 1.23,
|
|
1101
|
+
'expect': true
|
|
1101
1102
|
},
|
|
1102
1103
|
{
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1104
|
+
'inputName': 'number -1.23',
|
|
1105
|
+
'inputValue': -1.23,
|
|
1106
|
+
'expect': false
|
|
1106
1107
|
},
|
|
1107
1108
|
...defaultItemss({
|
|
1108
|
-
|
|
1109
|
-
|
|
1109
|
+
'number 0': false,
|
|
1110
|
+
'number 1': true
|
|
1110
1111
|
})
|
|
1111
1112
|
]
|
|
1112
1113
|
},
|
|
1113
1114
|
{
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1115
|
+
'name': 'Number larger than 1',
|
|
1116
|
+
'rule': 'number(1, )',
|
|
1117
|
+
'items': [
|
|
1117
1118
|
{
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1119
|
+
'inputName': 'number -1',
|
|
1120
|
+
'inputValue': -1,
|
|
1121
|
+
'expect': false
|
|
1121
1122
|
},
|
|
1122
1123
|
{
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1124
|
+
'inputName': 'number 1',
|
|
1125
|
+
'inputValue': 1,
|
|
1126
|
+
'expect': true
|
|
1126
1127
|
},
|
|
1127
1128
|
{
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1129
|
+
'inputName': 'number 10',
|
|
1130
|
+
'inputValue': 10,
|
|
1131
|
+
'expect': true
|
|
1131
1132
|
},
|
|
1132
1133
|
{
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1134
|
+
'inputName': 'number 11',
|
|
1135
|
+
'inputValue': 11,
|
|
1136
|
+
'expect': true
|
|
1136
1137
|
},
|
|
1137
1138
|
{
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1139
|
+
'inputName': 'number 0',
|
|
1140
|
+
'inputValue': 0,
|
|
1141
|
+
'expect': false
|
|
1141
1142
|
},
|
|
1142
1143
|
{
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1144
|
+
'inputName': 'number 1.23',
|
|
1145
|
+
'inputValue': 1.23,
|
|
1146
|
+
'expect': true
|
|
1146
1147
|
},
|
|
1147
1148
|
{
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1149
|
+
'inputName': 'number -1.23',
|
|
1150
|
+
'inputValue': -1.23,
|
|
1151
|
+
'expect': false
|
|
1151
1152
|
},
|
|
1152
1153
|
...defaultItemss({
|
|
1153
|
-
|
|
1154
|
-
|
|
1154
|
+
'number 0': false,
|
|
1155
|
+
'number 1': true
|
|
1155
1156
|
})
|
|
1156
1157
|
]
|
|
1157
1158
|
},
|
|
1158
1159
|
{
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
'name': 'Wrong expression for number: number(,)',
|
|
1161
|
+
'rule': 'number(,)',
|
|
1162
|
+
'items': [
|
|
1162
1163
|
{
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1164
|
+
'inputName': 'any',
|
|
1165
|
+
'inputValue': 'any',
|
|
1166
|
+
'expect': 'throw'
|
|
1166
1167
|
},
|
|
1167
1168
|
]
|
|
1168
1169
|
},
|
|
1169
1170
|
{
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1171
|
+
'name': 'Number lower than -1',
|
|
1172
|
+
'rule': 'number(, -1)',
|
|
1173
|
+
'items': [
|
|
1173
1174
|
{
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1175
|
+
'inputName': 'number -1',
|
|
1176
|
+
'inputValue': -1,
|
|
1177
|
+
'expect': true
|
|
1177
1178
|
},
|
|
1178
1179
|
{
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1180
|
+
'inputName': 'number 1',
|
|
1181
|
+
'inputValue': 1,
|
|
1182
|
+
'expect': false
|
|
1182
1183
|
},
|
|
1183
1184
|
{
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1185
|
+
'inputName': 'number -0.3',
|
|
1186
|
+
'inputValue': -0.3,
|
|
1187
|
+
'expect': false
|
|
1187
1188
|
},
|
|
1188
1189
|
{
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1190
|
+
'inputName': 'number -11',
|
|
1191
|
+
'inputValue': -11,
|
|
1192
|
+
'expect': true
|
|
1192
1193
|
},
|
|
1193
1194
|
{
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1195
|
+
'inputName': 'number 0',
|
|
1196
|
+
'inputValue': 0,
|
|
1197
|
+
'expect': false
|
|
1197
1198
|
},
|
|
1198
1199
|
{
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1200
|
+
'inputName': 'number -1.23',
|
|
1201
|
+
'inputValue': -1.23,
|
|
1202
|
+
'expect': true
|
|
1202
1203
|
},
|
|
1203
1204
|
...defaultItemss({
|
|
1204
|
-
|
|
1205
|
-
|
|
1205
|
+
'number 0': false,
|
|
1206
|
+
'number 1': false
|
|
1206
1207
|
})
|
|
1207
1208
|
]
|
|
1208
1209
|
},
|
|
1209
1210
|
{
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1211
|
+
'name': 'Numeric value',
|
|
1212
|
+
'rule': 'numeric',
|
|
1213
|
+
'items': [
|
|
1213
1214
|
{
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1215
|
+
'inputName': 'string \'120312\'',
|
|
1216
|
+
'inputValue': '120312',
|
|
1217
|
+
'expect': true
|
|
1217
1218
|
},
|
|
1218
1219
|
{
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1220
|
+
'inputName': 'string \'2.23\'',
|
|
1221
|
+
'inputValue': '2.23',
|
|
1222
|
+
'expect': true
|
|
1222
1223
|
},
|
|
1223
1224
|
{
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1225
|
+
'inputName': 'string \'2.23.4\'',
|
|
1226
|
+
'inputValue': '2.23.4',
|
|
1227
|
+
'expect': false
|
|
1227
1228
|
},
|
|
1228
1229
|
{
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1230
|
+
'inputName': 'number -1',
|
|
1231
|
+
'inputValue': -1,
|
|
1232
|
+
'expect': true
|
|
1232
1233
|
},
|
|
1233
1234
|
{
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1235
|
+
'inputName': 'number 120312',
|
|
1236
|
+
'inputValue': 120312,
|
|
1237
|
+
'expect': true
|
|
1237
1238
|
},
|
|
1238
1239
|
{
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1240
|
+
'inputName': 'number 1.23',
|
|
1241
|
+
'inputValue': 1.23,
|
|
1242
|
+
'expect': true
|
|
1242
1243
|
},
|
|
1243
1244
|
{
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1245
|
+
'inputName': 'number -1.23',
|
|
1246
|
+
'inputValue': -1.23,
|
|
1247
|
+
'expect': true
|
|
1247
1248
|
},
|
|
1248
1249
|
...defaultItemss({
|
|
1249
|
-
|
|
1250
|
-
|
|
1250
|
+
'number 0': true,
|
|
1251
|
+
'number 1': true
|
|
1251
1252
|
})
|
|
1252
1253
|
]
|
|
1253
1254
|
},
|
|
1254
1255
|
{
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1256
|
+
'name': 'Numeric value between 10 and 100',
|
|
1257
|
+
'rule': 'numeric(10,100)',
|
|
1258
|
+
'items': [
|
|
1258
1259
|
{
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1260
|
+
'inputName': 'string \'50\'',
|
|
1261
|
+
'inputValue': '50',
|
|
1262
|
+
'expect': true
|
|
1262
1263
|
},
|
|
1263
1264
|
{
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1265
|
+
'inputName': 'string \'22.23\'',
|
|
1266
|
+
'inputValue': '22.23',
|
|
1267
|
+
'expect': true
|
|
1267
1268
|
},
|
|
1268
1269
|
{
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1270
|
+
'inputName': 'string \'2.23.4\'',
|
|
1271
|
+
'inputValue': '2.23.4',
|
|
1272
|
+
'expect': false
|
|
1272
1273
|
},
|
|
1273
1274
|
{
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1275
|
+
'inputName': 'number -1',
|
|
1276
|
+
'inputValue': -1,
|
|
1277
|
+
'expect': false
|
|
1277
1278
|
},
|
|
1278
1279
|
{
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1280
|
+
'inputName': 'number 120312',
|
|
1281
|
+
'inputValue': 120312,
|
|
1282
|
+
'expect': false
|
|
1282
1283
|
},
|
|
1283
1284
|
{
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1285
|
+
'inputName': 'number 11.23',
|
|
1286
|
+
'inputValue': 11.23,
|
|
1287
|
+
'expect': true
|
|
1287
1288
|
},
|
|
1288
1289
|
{
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1290
|
+
'inputName': 'number -1.23',
|
|
1291
|
+
'inputValue': -1.23,
|
|
1292
|
+
'expect': false
|
|
1292
1293
|
},
|
|
1293
1294
|
...defaultItemss({
|
|
1294
|
-
|
|
1295
|
-
|
|
1295
|
+
'number 0': false,
|
|
1296
|
+
'number 1': false
|
|
1296
1297
|
})
|
|
1297
1298
|
]
|
|
1298
1299
|
},
|
|
1299
1300
|
{
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1301
|
+
'name': 'Numeric value not lower than 10',
|
|
1302
|
+
'rule': 'numeric(10,)',
|
|
1303
|
+
'items': [
|
|
1303
1304
|
{
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1305
|
+
'inputName': 'string \'50\'',
|
|
1306
|
+
'inputValue': '50',
|
|
1307
|
+
'expect': true
|
|
1307
1308
|
},
|
|
1308
1309
|
{
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1310
|
+
'inputName': 'string \'22.23\'',
|
|
1311
|
+
'inputValue': '22.23',
|
|
1312
|
+
'expect': true
|
|
1312
1313
|
},
|
|
1313
1314
|
{
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1315
|
+
'inputName': 'string \'2.23.4\'',
|
|
1316
|
+
'inputValue': '2.23.4',
|
|
1317
|
+
'expect': false
|
|
1317
1318
|
},
|
|
1318
1319
|
{
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1320
|
+
'inputName': 'number -1',
|
|
1321
|
+
'inputValue': -1,
|
|
1322
|
+
'expect': false
|
|
1322
1323
|
},
|
|
1323
1324
|
{
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1325
|
+
'inputName': 'number 120312',
|
|
1326
|
+
'inputValue': 120312,
|
|
1327
|
+
'expect': true
|
|
1327
1328
|
},
|
|
1328
1329
|
{
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1330
|
+
'inputName': 'number 11.23',
|
|
1331
|
+
'inputValue': 11.23,
|
|
1332
|
+
'expect': true
|
|
1332
1333
|
},
|
|
1333
1334
|
{
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1335
|
+
'inputName': 'number -1.23',
|
|
1336
|
+
'inputValue': -1.23,
|
|
1337
|
+
'expect': false
|
|
1337
1338
|
},
|
|
1338
1339
|
...defaultItemss({
|
|
1339
|
-
|
|
1340
|
-
|
|
1340
|
+
'number 0': false,
|
|
1341
|
+
'number 1': false
|
|
1341
1342
|
})
|
|
1342
1343
|
]
|
|
1343
1344
|
},
|
|
1344
1345
|
{
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1346
|
+
'name': 'Numeric value not lower than 10',
|
|
1347
|
+
'rule': 'numeric(,100)',
|
|
1348
|
+
'items': [
|
|
1348
1349
|
{
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1350
|
+
'inputName': 'string \'50\'',
|
|
1351
|
+
'inputValue': '50',
|
|
1352
|
+
'expect': true
|
|
1352
1353
|
},
|
|
1353
1354
|
{
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1355
|
+
'inputName': 'string \'22.23\'',
|
|
1356
|
+
'inputValue': '22.23',
|
|
1357
|
+
'expect': true
|
|
1357
1358
|
},
|
|
1358
1359
|
{
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1360
|
+
'inputName': 'string \'2.23.4\'',
|
|
1361
|
+
'inputValue': '2.23.4',
|
|
1362
|
+
'expect': false
|
|
1362
1363
|
},
|
|
1363
1364
|
{
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1365
|
+
'inputName': 'number -1',
|
|
1366
|
+
'inputValue': -1,
|
|
1367
|
+
'expect': true
|
|
1367
1368
|
},
|
|
1368
1369
|
{
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1370
|
+
'inputName': 'number 120312',
|
|
1371
|
+
'inputValue': 120312,
|
|
1372
|
+
'expect': false
|
|
1372
1373
|
},
|
|
1373
1374
|
{
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1375
|
+
'inputName': 'number 11.23',
|
|
1376
|
+
'inputValue': 11.23,
|
|
1377
|
+
'expect': true
|
|
1377
1378
|
},
|
|
1378
1379
|
{
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1380
|
+
'inputName': 'number -1.23',
|
|
1381
|
+
'inputValue': -1.23,
|
|
1382
|
+
'expect': true
|
|
1382
1383
|
},
|
|
1383
1384
|
...defaultItemss({
|
|
1384
|
-
|
|
1385
|
-
|
|
1385
|
+
'number 0': true,
|
|
1386
|
+
'number 1': true
|
|
1386
1387
|
})
|
|
1387
1388
|
]
|
|
1388
1389
|
},
|
|
1389
1390
|
{
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1391
|
+
'name': 'Void',
|
|
1392
|
+
'rule': 'void',
|
|
1393
|
+
'items': [
|
|
1393
1394
|
...defaultItemss({
|
|
1394
|
-
|
|
1395
|
+
'undefined': true
|
|
1395
1396
|
})
|
|
1396
1397
|
]
|
|
1397
1398
|
},
|
|
1398
1399
|
{
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1400
|
+
'name': 'Optional',
|
|
1401
|
+
'rule': 'optional',
|
|
1402
|
+
'items': [
|
|
1402
1403
|
...defaultItemss({
|
|
1403
|
-
|
|
1404
|
+
'undefined': true
|
|
1404
1405
|
})
|
|
1405
1406
|
]
|
|
1406
1407
|
},
|
|
1407
1408
|
{
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1409
|
+
'name': 'Undefined',
|
|
1410
|
+
'rule': 'undefined',
|
|
1411
|
+
'items': [
|
|
1411
1412
|
...defaultItemss({
|
|
1412
|
-
|
|
1413
|
+
'undefined': true
|
|
1413
1414
|
})
|
|
1414
1415
|
]
|
|
1415
1416
|
},
|
|
1416
1417
|
{
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1418
|
+
'name': 'Required',
|
|
1419
|
+
'rule': 'required',
|
|
1420
|
+
'items': [
|
|
1420
1421
|
...defaultItemss({
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1422
|
+
'true': true,
|
|
1423
|
+
'false': true,
|
|
1424
|
+
'null': true,
|
|
1425
|
+
'empty array': true,
|
|
1426
|
+
'string \'hello\'': true,
|
|
1427
|
+
'empty string': true,
|
|
1428
|
+
'object': true,
|
|
1429
|
+
'number 0': true,
|
|
1430
|
+
'number 1': true
|
|
1430
1431
|
})
|
|
1431
1432
|
]
|
|
1432
1433
|
},
|
|
1433
1434
|
{
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1435
|
+
'name': 'Null',
|
|
1436
|
+
'rule': 'null',
|
|
1437
|
+
'items': [
|
|
1437
1438
|
...defaultItemss({
|
|
1438
|
-
|
|
1439
|
+
'null': true
|
|
1439
1440
|
})
|
|
1440
1441
|
]
|
|
1441
1442
|
},
|
|
1442
1443
|
{
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1444
|
+
'name': 'Array',
|
|
1445
|
+
'rule': 'array',
|
|
1446
|
+
'items': [
|
|
1446
1447
|
{
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1448
|
+
'inputName': '[string, number]',
|
|
1449
|
+
'inputValue': ['-1.23', 123123],
|
|
1450
|
+
'expect': true
|
|
1450
1451
|
},
|
|
1451
1452
|
...defaultItemss({
|
|
1452
|
-
|
|
1453
|
+
'empty array': true
|
|
1453
1454
|
})
|
|
1454
1455
|
]
|
|
1455
1456
|
},
|
|
1456
1457
|
{
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1458
|
+
'name': 'Array with 1 element',
|
|
1459
|
+
'rule': 'array(1)',
|
|
1460
|
+
'items': [
|
|
1460
1461
|
{
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1462
|
+
'inputName': '[string, number]',
|
|
1463
|
+
'inputValue': ['-1.23', 123123],
|
|
1464
|
+
'expect': false
|
|
1464
1465
|
},
|
|
1465
1466
|
{
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1467
|
+
'inputName': '[string]',
|
|
1468
|
+
'inputValue': ['-1.23'],
|
|
1469
|
+
'expect': true
|
|
1469
1470
|
},
|
|
1470
1471
|
...defaultItemss({
|
|
1471
|
-
|
|
1472
|
+
'empty array': false
|
|
1472
1473
|
})
|
|
1473
1474
|
]
|
|
1474
1475
|
},
|
|
1475
1476
|
{
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1477
|
+
'name': 'Array with 1 ~ 3 elements',
|
|
1478
|
+
'rule': 'array(1,3)',
|
|
1479
|
+
'items': [
|
|
1479
1480
|
{
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1481
|
+
'inputName': '[string, number, boolean]',
|
|
1482
|
+
'inputValue': ['-1.23', 123123, true],
|
|
1483
|
+
'expect': true
|
|
1483
1484
|
},
|
|
1484
1485
|
{
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1486
|
+
'inputName': '[string, number]',
|
|
1487
|
+
'inputValue': ['-1.23', 123123],
|
|
1488
|
+
'expect': true
|
|
1488
1489
|
},
|
|
1489
1490
|
{
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1491
|
+
'inputName': '[string]',
|
|
1492
|
+
'inputValue': ['-1.23'],
|
|
1493
|
+
'expect': true
|
|
1493
1494
|
},
|
|
1494
1495
|
{
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1496
|
+
'inputName': '[string, number, boolean, string]',
|
|
1497
|
+
'inputValue': ['-1.23', 123123, true, 'fff'],
|
|
1498
|
+
'expect': false
|
|
1498
1499
|
},
|
|
1499
1500
|
...defaultItemss({
|
|
1500
|
-
|
|
1501
|
+
'empty array': false
|
|
1501
1502
|
})
|
|
1502
1503
|
]
|
|
1503
1504
|
},
|
|
1504
1505
|
{
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1506
|
+
'name': 'Array with at least 1 element',
|
|
1507
|
+
'rule': 'array(1,)',
|
|
1508
|
+
'items': [
|
|
1508
1509
|
{
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1510
|
+
'inputName': '[string, number]',
|
|
1511
|
+
'inputValue': ['-1.23', 123123],
|
|
1512
|
+
'expect': true
|
|
1512
1513
|
},
|
|
1513
1514
|
{
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1515
|
+
'inputName': '[string]',
|
|
1516
|
+
'inputValue': ['-1.23'],
|
|
1517
|
+
'expect': true
|
|
1517
1518
|
},
|
|
1518
1519
|
...defaultItemss({
|
|
1519
|
-
|
|
1520
|
+
'empty array': false
|
|
1520
1521
|
})
|
|
1521
1522
|
]
|
|
1522
1523
|
},
|
|
1523
1524
|
{
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1525
|
+
'name': 'Wrong expression for array: array(,)',
|
|
1526
|
+
'rule': 'array(,)',
|
|
1527
|
+
'items': [
|
|
1527
1528
|
{
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1529
|
+
'inputName': 'any',
|
|
1530
|
+
'inputValue': 'any',
|
|
1531
|
+
'expect': 'throw'
|
|
1531
1532
|
},
|
|
1532
1533
|
]
|
|
1533
1534
|
},
|
|
1534
1535
|
{
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1536
|
+
'name': 'Struct',
|
|
1537
|
+
'rule': 'struct',
|
|
1538
|
+
'items': [
|
|
1538
1539
|
...defaultItemss({
|
|
1539
|
-
|
|
1540
|
+
'object': true
|
|
1540
1541
|
})
|
|
1541
1542
|
]
|
|
1542
1543
|
},
|
|
1543
1544
|
{
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1545
|
+
'name': 'Decimal',
|
|
1546
|
+
'rule': 'decimal',
|
|
1547
|
+
'items': [
|
|
1547
1548
|
{
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1549
|
+
'inputName': 'number 1.00',
|
|
1550
|
+
'inputValue': 1.00,
|
|
1551
|
+
'expect': false
|
|
1551
1552
|
},
|
|
1552
1553
|
{
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1554
|
+
'inputName': 'string \'1.00\'',
|
|
1555
|
+
'inputValue': '1.00',
|
|
1556
|
+
'expect': true
|
|
1556
1557
|
},
|
|
1557
1558
|
{
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1559
|
+
'inputName': 'string \'+1.00\'',
|
|
1560
|
+
'inputValue': '+1.00',
|
|
1561
|
+
'expect': true
|
|
1561
1562
|
},
|
|
1562
1563
|
{
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1564
|
+
'inputName': 'string \'0.00\'',
|
|
1565
|
+
'inputValue': '0.00',
|
|
1566
|
+
'expect': true
|
|
1566
1567
|
},
|
|
1567
1568
|
{
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1569
|
+
'inputName': 'string \'10.00\'',
|
|
1570
|
+
'inputValue': '10.00',
|
|
1571
|
+
'expect': true
|
|
1571
1572
|
},
|
|
1572
1573
|
{
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1574
|
+
'inputName': 'string \'-10.00\'',
|
|
1575
|
+
'inputValue': '-10.00',
|
|
1576
|
+
'expect': true
|
|
1576
1577
|
},
|
|
1577
1578
|
{
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1579
|
+
'inputName': 'string \'010.00\'',
|
|
1580
|
+
'inputValue': '010.00',
|
|
1581
|
+
'expect': false
|
|
1581
1582
|
},
|
|
1582
1583
|
{
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1584
|
+
'inputName': 'string \'.00\'',
|
|
1585
|
+
'inputValue': '.00',
|
|
1586
|
+
'expect': false
|
|
1586
1587
|
},
|
|
1587
1588
|
{
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1589
|
+
'inputName': 'string \'0.\'',
|
|
1590
|
+
'inputValue': '0.',
|
|
1591
|
+
'expect': false
|
|
1591
1592
|
},
|
|
1592
1593
|
{
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1594
|
+
'inputName': 'string \'0.00.0\'',
|
|
1595
|
+
'inputValue': '0.00.0',
|
|
1596
|
+
'expect': false
|
|
1596
1597
|
},
|
|
1597
1598
|
...defaultItemss({})
|
|
1598
1599
|
]
|
|
1599
1600
|
},
|
|
1600
1601
|
{
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1602
|
+
'name': 'Decimal with 5 effective digitals',
|
|
1603
|
+
'rule': 'decimal(5)',
|
|
1604
|
+
'items': [
|
|
1604
1605
|
{
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1606
|
+
'inputName': 'number 1.00',
|
|
1607
|
+
'inputValue': 1.00,
|
|
1608
|
+
'expect': false
|
|
1608
1609
|
},
|
|
1609
1610
|
{
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1611
|
+
'inputName': 'string \'1.00\'',
|
|
1612
|
+
'inputValue': '1.00',
|
|
1613
|
+
'expect': true
|
|
1613
1614
|
},
|
|
1614
1615
|
{
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1616
|
+
'inputName': 'string \'0.00\'',
|
|
1617
|
+
'inputValue': '0.00',
|
|
1618
|
+
'expect': true
|
|
1618
1619
|
},
|
|
1619
1620
|
{
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1621
|
+
'inputName': 'string \'10.00\'',
|
|
1622
|
+
'inputValue': '10.00',
|
|
1623
|
+
'expect': true
|
|
1623
1624
|
},
|
|
1624
1625
|
{
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1626
|
+
'inputName': 'string \'-10.00\'',
|
|
1627
|
+
'inputValue': '-10.00',
|
|
1628
|
+
'expect': true
|
|
1628
1629
|
},
|
|
1629
1630
|
{
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1631
|
+
'inputName': 'string \'10000\'',
|
|
1632
|
+
'inputValue': '10000',
|
|
1633
|
+
'expect': true
|
|
1633
1634
|
},
|
|
1634
1635
|
{
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1636
|
+
'inputName': 'string \'100000\'',
|
|
1637
|
+
'inputValue': '100000',
|
|
1638
|
+
'expect': false
|
|
1638
1639
|
},
|
|
1639
1640
|
{
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1641
|
+
'inputName': 'string \'00001.0\'',
|
|
1642
|
+
'inputValue': '00001.0',
|
|
1643
|
+
'expect': false
|
|
1643
1644
|
},
|
|
1644
1645
|
{
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1646
|
+
'inputName': 'string \'1.00123\'',
|
|
1647
|
+
'inputValue': '1.00123',
|
|
1648
|
+
'expect': false
|
|
1648
1649
|
},
|
|
1649
1650
|
{
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1651
|
+
'inputName': 'string \'010.00\'',
|
|
1652
|
+
'inputValue': '010.00',
|
|
1653
|
+
'expect': false
|
|
1653
1654
|
},
|
|
1654
1655
|
{
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1656
|
+
'inputName': 'string \'.00\'',
|
|
1657
|
+
'inputValue': '.00',
|
|
1658
|
+
'expect': false
|
|
1658
1659
|
},
|
|
1659
1660
|
{
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1661
|
+
'inputName': 'string \'0.\'',
|
|
1662
|
+
'inputValue': '0.',
|
|
1663
|
+
'expect': false
|
|
1663
1664
|
},
|
|
1664
1665
|
{
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1666
|
+
'inputName': 'string \'0.00.0\'',
|
|
1667
|
+
'inputValue': '0.00.0',
|
|
1668
|
+
'expect': false
|
|
1668
1669
|
},
|
|
1669
1670
|
...defaultItemss({})
|
|
1670
1671
|
]
|
|
1671
1672
|
},
|
|
1672
1673
|
{
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1674
|
+
'name': 'Decimal with 5 effective digitals, while 2 after dot',
|
|
1675
|
+
'rule': 'decimal(5, 2)',
|
|
1676
|
+
'items': [
|
|
1676
1677
|
{
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1678
|
+
'inputName': 'number 1.00',
|
|
1679
|
+
'inputValue': 1.00,
|
|
1680
|
+
'expect': false
|
|
1680
1681
|
},
|
|
1681
1682
|
{
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1683
|
+
'inputName': 'string \'1.00\'',
|
|
1684
|
+
'inputValue': '1.00',
|
|
1685
|
+
'expect': true
|
|
1685
1686
|
},
|
|
1686
1687
|
{
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1688
|
+
'inputName': 'string \'0.00\'',
|
|
1689
|
+
'inputValue': '0.00',
|
|
1690
|
+
'expect': true
|
|
1690
1691
|
},
|
|
1691
1692
|
{
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1693
|
+
'inputName': 'string \'10.00\'',
|
|
1694
|
+
'inputValue': '10.00',
|
|
1695
|
+
'expect': true
|
|
1695
1696
|
},
|
|
1696
1697
|
{
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1698
|
+
'inputName': 'string \'+10.00\'',
|
|
1699
|
+
'inputValue': '+10.00',
|
|
1700
|
+
'expect': true
|
|
1700
1701
|
},
|
|
1701
1702
|
{
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1703
|
+
'inputName': 'string \'100.12\'',
|
|
1704
|
+
'inputValue': '100.12',
|
|
1705
|
+
'expect': true
|
|
1705
1706
|
},
|
|
1706
1707
|
{
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1708
|
+
'inputName': 'string \'-100.12\'',
|
|
1709
|
+
'inputValue': '-100.12',
|
|
1710
|
+
'expect': true
|
|
1710
1711
|
},
|
|
1711
1712
|
{
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1713
|
+
'inputName': 'string \'1100.1\'',
|
|
1714
|
+
'inputValue': '1100.1',
|
|
1715
|
+
'expect': false
|
|
1715
1716
|
},
|
|
1716
1717
|
{
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1718
|
+
'inputName': 'string \'11.123\'',
|
|
1719
|
+
'inputValue': '10.123',
|
|
1720
|
+
'expect': false
|
|
1720
1721
|
},
|
|
1721
1722
|
{
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1723
|
+
'inputName': 'string \'100000\'',
|
|
1724
|
+
'inputValue': '100000',
|
|
1725
|
+
'expect': false
|
|
1725
1726
|
},
|
|
1726
1727
|
{
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1728
|
+
'inputName': 'string \'00001.0\'',
|
|
1729
|
+
'inputValue': '00001.0',
|
|
1730
|
+
'expect': false
|
|
1730
1731
|
},
|
|
1731
1732
|
{
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1733
|
+
'inputName': 'string \'1.00123\'',
|
|
1734
|
+
'inputValue': '1.00123',
|
|
1735
|
+
'expect': false
|
|
1735
1736
|
},
|
|
1736
1737
|
{
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1738
|
+
'inputName': 'string \'010.00\'',
|
|
1739
|
+
'inputValue': '010.00',
|
|
1740
|
+
'expect': false
|
|
1740
1741
|
},
|
|
1741
1742
|
{
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1743
|
+
'inputName': 'string \'.00\'',
|
|
1744
|
+
'inputValue': '.00',
|
|
1745
|
+
'expect': false
|
|
1745
1746
|
},
|
|
1746
1747
|
{
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1748
|
+
'inputName': 'string \'0.\'',
|
|
1749
|
+
'inputValue': '0.',
|
|
1750
|
+
'expect': false
|
|
1750
1751
|
},
|
|
1751
1752
|
{
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1753
|
+
'inputName': 'string \'0.00.0\'',
|
|
1754
|
+
'inputValue': '0.00.0',
|
|
1755
|
+
'expect': false
|
|
1755
1756
|
},
|
|
1756
1757
|
...defaultItemss({})
|
|
1757
1758
|
]
|
|
1758
1759
|
},
|
|
1759
1760
|
{
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1761
|
+
'name': 'Mapping of string',
|
|
1762
|
+
'rule': 'string{}',
|
|
1763
|
+
'items': [
|
|
1763
1764
|
{
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1765
|
+
'inputName': JSON.stringify({
|
|
1766
|
+
'a': 'bbbb',
|
|
1767
|
+
'b': 'ccccc'
|
|
1767
1768
|
}),
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1769
|
+
'inputValue': {
|
|
1770
|
+
'a': 'bbbb',
|
|
1771
|
+
'b': 'ccccc'
|
|
1771
1772
|
},
|
|
1772
|
-
|
|
1773
|
+
'expect': true
|
|
1773
1774
|
},
|
|
1774
1775
|
{
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1776
|
+
'inputName': JSON.stringify({
|
|
1777
|
+
'a': 'bbbb',
|
|
1778
|
+
'b': 321
|
|
1778
1779
|
}),
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1780
|
+
'inputValue': {
|
|
1781
|
+
'a': 'bbbb',
|
|
1782
|
+
'b': 321
|
|
1782
1783
|
},
|
|
1783
|
-
|
|
1784
|
+
'expect': false
|
|
1784
1785
|
},
|
|
1785
1786
|
{
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1787
|
+
'inputName': '[string, string, string]',
|
|
1788
|
+
'inputValue': ['a', 'b', 'c'],
|
|
1789
|
+
'expect': false
|
|
1789
1790
|
},
|
|
1790
1791
|
...defaultItemss({
|
|
1791
|
-
|
|
1792
|
+
'object': true
|
|
1792
1793
|
})
|
|
1793
1794
|
]
|
|
1794
1795
|
},
|
|
1795
1796
|
{
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1797
|
+
'name': 'Array of string',
|
|
1798
|
+
'rule': 'string[]',
|
|
1799
|
+
'items': [
|
|
1799
1800
|
{
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1801
|
+
'inputName': '[string, string]',
|
|
1802
|
+
'inputValue': ['a', '123'],
|
|
1803
|
+
'expect': true
|
|
1803
1804
|
},
|
|
1804
1805
|
{
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1806
|
+
'inputName': '[string]',
|
|
1807
|
+
'inputValue': ['a'],
|
|
1808
|
+
'expect': true
|
|
1808
1809
|
},
|
|
1809
1810
|
{
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1811
|
+
'inputName': '[string, number]',
|
|
1812
|
+
'inputValue': ['a', 123],
|
|
1813
|
+
'expect': false
|
|
1813
1814
|
},
|
|
1814
1815
|
...defaultItemss({
|
|
1815
|
-
|
|
1816
|
+
'empty array': true
|
|
1816
1817
|
})
|
|
1817
1818
|
]
|
|
1818
1819
|
},
|
|
1819
1820
|
{
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1821
|
+
'name': 'String array contains 0 elements.',
|
|
1822
|
+
'rule': 'string[0]',
|
|
1823
|
+
'items': [
|
|
1823
1824
|
{
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1825
|
+
'inputName': '[string]',
|
|
1826
|
+
'inputValue': ['a'],
|
|
1827
|
+
'expect': false
|
|
1827
1828
|
},
|
|
1828
1829
|
{
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1830
|
+
'inputName': '[string, number]',
|
|
1831
|
+
'inputValue': ['a', 123],
|
|
1832
|
+
'expect': false
|
|
1832
1833
|
},
|
|
1833
1834
|
...defaultItemss({
|
|
1834
|
-
|
|
1835
|
+
'empty array': true
|
|
1835
1836
|
})
|
|
1836
1837
|
]
|
|
1837
1838
|
},
|
|
1838
1839
|
{
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1840
|
+
'name': 'String array contains 3 elements.',
|
|
1841
|
+
'rule': 'string[3]',
|
|
1842
|
+
'items': [
|
|
1842
1843
|
{
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1844
|
+
'inputName': '[string, string, string]',
|
|
1845
|
+
'inputValue': ['a', 'b', 'c'],
|
|
1846
|
+
'expect': true
|
|
1846
1847
|
},
|
|
1847
1848
|
{
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1849
|
+
'inputName': '[string, string, number]',
|
|
1850
|
+
'inputValue': ['a', 'b', 123],
|
|
1851
|
+
'expect': false
|
|
1851
1852
|
},
|
|
1852
1853
|
{
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1854
|
+
'inputName': '[string, string]',
|
|
1855
|
+
'inputValue': ['a', 'b'],
|
|
1856
|
+
'expect': false
|
|
1856
1857
|
},
|
|
1857
1858
|
{
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1859
|
+
'inputName': '[string]',
|
|
1860
|
+
'inputValue': ['a'],
|
|
1861
|
+
'expect': false
|
|
1861
1862
|
},
|
|
1862
1863
|
{
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1864
|
+
'inputName': '[string, number]',
|
|
1865
|
+
'inputValue': ['a', 123],
|
|
1866
|
+
'expect': false
|
|
1866
1867
|
},
|
|
1867
1868
|
...defaultItemss({})
|
|
1868
1869
|
]
|
|
1869
1870
|
},
|
|
1870
1871
|
{
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1872
|
+
'name': 'String array contains 0 ~ 3 elements.',
|
|
1873
|
+
'rule': 'string[0,3]',
|
|
1874
|
+
'items': [
|
|
1874
1875
|
{
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1876
|
+
'inputName': '[string, string, string]',
|
|
1877
|
+
'inputValue': ['a', 'b', 'c'],
|
|
1878
|
+
'expect': true
|
|
1878
1879
|
},
|
|
1879
1880
|
{
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1881
|
+
'inputName': '[string, string, number]',
|
|
1882
|
+
'inputValue': ['a', 'b', 123],
|
|
1883
|
+
'expect': false
|
|
1883
1884
|
},
|
|
1884
1885
|
{
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1886
|
+
'inputName': '[string, string]',
|
|
1887
|
+
'inputValue': ['a', 'b'],
|
|
1888
|
+
'expect': true
|
|
1888
1889
|
},
|
|
1889
1890
|
{
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1891
|
+
'inputName': '[string]',
|
|
1892
|
+
'inputValue': ['a'],
|
|
1893
|
+
'expect': true
|
|
1893
1894
|
},
|
|
1894
1895
|
{
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1896
|
+
'inputName': '[string, number]',
|
|
1897
|
+
'inputValue': ['a', 123],
|
|
1898
|
+
'expect': false
|
|
1898
1899
|
},
|
|
1899
1900
|
...defaultItemss({
|
|
1900
|
-
|
|
1901
|
+
'empty array': true
|
|
1901
1902
|
})
|
|
1902
1903
|
]
|
|
1903
1904
|
},
|
|
1904
1905
|
{
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1906
|
+
'name': 'Array contains 0 ~ 3 string values that each contains 1 ~ 5 characters.',
|
|
1907
|
+
'rule': 'string(1,5)[0,3]',
|
|
1908
|
+
'items': [
|
|
1908
1909
|
{
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1910
|
+
'inputName': '[string, string, string]',
|
|
1911
|
+
'inputValue': ['a', 'b', 'c'],
|
|
1912
|
+
'expect': true
|
|
1912
1913
|
},
|
|
1913
1914
|
{
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1915
|
+
'inputName': '[string, string, number]',
|
|
1916
|
+
'inputValue': ['a', 'b', 123],
|
|
1917
|
+
'expect': false
|
|
1917
1918
|
},
|
|
1918
1919
|
{
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1920
|
+
'inputName': '[string, string]',
|
|
1921
|
+
'inputValue': ['a', 'b'],
|
|
1922
|
+
'expect': true
|
|
1922
1923
|
},
|
|
1923
1924
|
{
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1925
|
+
'inputName': '[string, string, string(7)]',
|
|
1926
|
+
'inputValue': ['a', 'b', 'aaabbbc'],
|
|
1927
|
+
'expect': false
|
|
1927
1928
|
},
|
|
1928
1929
|
{
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1930
|
+
'inputName': '[string]',
|
|
1931
|
+
'inputValue': ['a'],
|
|
1932
|
+
'expect': true
|
|
1932
1933
|
},
|
|
1933
1934
|
{
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1935
|
+
'inputName': '[string, number]',
|
|
1936
|
+
'inputValue': ['a', 123],
|
|
1937
|
+
'expect': false
|
|
1937
1938
|
},
|
|
1938
1939
|
...defaultItemss({
|
|
1939
|
-
|
|
1940
|
+
'empty array': true
|
|
1940
1941
|
})
|
|
1941
1942
|
]
|
|
1942
1943
|
},
|
|
1943
1944
|
{
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1945
|
+
'name': 'Optional string',
|
|
1946
|
+
'rule': '?string',
|
|
1947
|
+
'items': [
|
|
1947
1948
|
{
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1949
|
+
'inputName': 'string \'fine\'',
|
|
1950
|
+
'inputValue': 'fine',
|
|
1951
|
+
'expect': true
|
|
1951
1952
|
},
|
|
1952
1953
|
...defaultItemss({
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1954
|
+
'undefined': true,
|
|
1955
|
+
'empty string': true,
|
|
1956
|
+
'string \'hello\'': true
|
|
1956
1957
|
})
|
|
1957
1958
|
]
|
|
1958
1959
|
}
|