frawor / test / fwctests.dat

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
#▶1 Invalid length
#▶2 Required
['_',                    'check'], range(0), 0
['_',                    'check'], range(2), 0
['_ _',                  'check'], range(3), 0
['()',                   'check'], range(1), 0
#▶2 Optinal
['[_]',                  'check'], range(2), 0
['[_][_ _]',             'check'], range(3), 0
['[_][_[_]]',            'check'], range(4), 0
['[_ [_ _]]',            'check'], range(4), 0
#['[_][_ _ _]',           'check'], range(2), 0
['[]',                   'check'], range(1), 0
#▶2 Required+optional
['_[_]',                 'check'], range(0), 0
['_[_[_]]',              'check'], range(4), 0
['_[_[_][_ _]]',         'check'], range(5), 0
['()[]',                 'check'], range(1), 0
#▶2 Required+next
['_+_',                  'check'], range(0), 0
['_ _ _ +_',             'check'], range(2), 0
#▶2 Required+optional+next
['_[_]+_',               'check'], range(0), 0
['_[_+_]',               'check'], range(0), 0
['_[[_]+_]',             'check'], range(0), 0
#▶2 Prefixes
['{p1 _}',               'check'], range(0), 0
['{p1 _}',               'check'], range(1), 0
['{+2 p1 _ _}',          'check'], range(2), 0
['{*p1 _}',              'check'], range(0), 0
['{p2 _ *p1 _}',         'check'], range(3), 0
['{?p1 _ !p2 -}',        'check'], range(0), 0
['{}',                   'check'], range(1), 0
#▶2 Actions+required
['<a1 ->',               'check'], range(0), 0
['<a1 ->',               'check'], range(2), 0
['<- _>',                'check'], range(0), 0
['<- _>',                'check'], range(2), 0
['<a1 - a2 _ a3 (_ _)>', 'check'], range(0), 0
['<a1 - a2 _ a3 (_ _)>', 'check'], range(4), 0
['<- ->',                'check'], range(1), 0
['<>',                   'check'], range(1), 0
#▶2 Actions+optional
['<a1 [_]>',             'check'], range(0), 0
['<a1 [_]>',             'check'], range(3), 0
['<- []>',               'check'], range(1), 0
#▶2 Actions+actions+required
['<a1 <a2 _>>',          'check'], range(2), 0
['<a1 <a2 _>>',          'check'], range(4), 0
['<- <- ->>',            'check'], range(1), 0
#▶1 Pipes
\function s:.revstring(str)
\    return join(reverse(split(a:str, '\v.@=')), '')
:endfunction
#▶2 Function pipes
['|*$"string"',                'filter'], ['abc'], ["'abc'"]
["|*$'string'",                'filter'], ['abc'], ["'abc'"]
['|*=function("string")',      'filter'], ['abc'], ["'abc'"]
['|*revstring',                'filter'], ['abc'], ['cba']
['|*$"string"(.)',             'filter'], ['abc'], ["'abc'"]
['|*=function("string")(.)',   'filter'], ['abc'], ["'abc'"]
['|*revstring(.)',             'filter'], ['abc'], ['cba']
['|*$"split"(. ''\v.@='')',    'filter'], ['abc'], [['a', 'b', 'c']]
['|*$"index"([abc def ghi])',  'filter'], ['abc'], [0]
['|*@',                        'filter'], [function('string')], ['function(''string'')']
['(|*@>) _',                   'filter'], ['abc', function('string')], ["'abc'", function('string')]
['_ |*@<',                     'filter'], [function('string'), 'abc'], [function('string'), "'abc'"]
['|*=((@.@[0] is "a")?(function("string")):(function("eval")))(.)', 'filter'], ['a0'], ["'a0'"]
['|*=((@.@[0] is "a")?(function("string")):(function("eval")))(.)', 'filter'], ['0'],  [0]
#▶2 Expression pipes
['|=string(@.@)',              'filter'], ['abc'], ["'abc'"]
#▶2 Built-in pipes
['func$"string"',          'filter'], ['abc'],              ["'abc'"]
['func revstring',         'filter'], ['abc'],              ['cba']
['eval string(@.@)',       'filter'], ['abc'],              ["'abc'"]
['run [abc]',              'filter'], ['string'],           ["'abc'"]
['run [abc]',              'filter'], [function('string')], ["'abc'"]
['run []',                 'filter'], ['()'],               0
['run [$[abc def]]',       'filter'], [s:.revstring],       0
['earg',                   'filter'], ['string("abc")'],    ["'abc'"]
['earg',                   'filter'], ['('],                0
['isfunc',                 'filter'], [0],                  0
['isfunc',                 'filter'], [function('tr')],     [function("tr")]
['take ={"abc": 1} start', 'filter'], ['a'],                [1]
['take ={"abc": 1} start', 'filter'], ['b'],                0
['take ={"abc": 1} start', 'filter'], [0],                  0
:let s:notbool=2
['value notbool bool',     'filter'], [0],                  [0]
:echom s:notbool
#▶3 if
['if bool () is =2',       'filter'], [2],                  [2]
['if bool () is =2',       'filter'], [1],                  [1]
['if bool () is =2',       'filter'], [3],                  0
['if bool |=(!@.@) ()',    'filter'], [0],                  [1]
['if bool |=(!@.@) ()',    'filter'], [1],                  [0]
['if bool |=(!@.@) ()',    'filter'], [2],                  [2]
['if bool (|=(!@.@)) is=2','filter'], [0],                  [1]
['if bool (|=(!@.@)) is=2','filter'], [1],                  [0]
['if bool (|=(!@.@)) is=2','filter'], [2],                  [2]
['if bool (|=(!@.@)) is=2','filter'], [3],                  0
#▶3 dict
['dict {abc bool}',        'filter'], [{'abc': {}}],        [{'abc': 0}]
['dict {abc bool}',        'filter'], [{'ab': {}}],         0
['dict {/^a/ bool}',       'filter'], [{'a': 2, 'ab': {}}], [{'a': 1, 'ab': 0}]
['dict {/^a/ bool}',       'filter'], [{'a': 2, 'Ab': {}}], 0
['dict {a isreg}',         'filter'], [{'a': '\v('}],       0
['dict {?isreg bool}',     'filter'], [{'abc': {}}],        [{'abc': 0}]
['dict {?isreg bool}',     'filter'], [{'\v(': {}}],        0
['dict {?isreg bool ?_ _}','filter'], [{'a': 4, '\v(': 2}], [{'a': 1, '\v(': 2}]
['dict {a _ ?isreg bool}', 'filter'], [{'a': 4, 'ab':  2}], [{'a': 4, 'ab':  1}]
['dict {*$"exists" bool}', 'filter'], [{'g:': []}],         [{'g:': 0}]
['dict {*$"exists" bool}', 'filter'], [{'g:+': []}],        0
['dict {=exists(@.@)bool}','filter'], [{'g:': []}],         [{'g:': 0}]
['dict {=exists(@.@)bool}','filter'], [{'g:+': []}],        0
['dict {- bool}',          'filter'], [{'abc': []}],        [{'abc': 0}]
['dict {abc bool - _}',    'filter'], [{'abc':[], 'ab':2}], [{'abc':0, 'ab':2}]
['dict {?isreg bool - _}', 'filter'], [{'a': [], '\v(': 2}],[{'a': 0, '\v(': 2}]
#▶3 tuple
['tuple bool, bool',       'filter'], [['', 'cba']],        [[0, 1]]
['tuple bool, bool',       'filter'], [['abc']],            0
['tuple bool, bool',       'filter'], ['abc'],              0
['tuple (?bool |=(!@.@))', 'filter'], [[1]],                [[0]]
['tuple (tuple bool tuple bool, bool)', 'filter'], [[[''],[4,0]]], [[[0],[1,0]]]
#▶3 list
['list bool',              'filter'], ["['abc', 'def']"],   0
['list bool',              'filter'], [['abc', 'def']],     [[1, 1]]
['list tuple bool, bool',  'filter'], [['ab', 'de']],       0
['list tuple bool, bool',  'filter'], [[[1, 2], [0, 3]]],   [[[1, 1], [0, 1]]]
['list list list ?bool',   'filter'], [1],                  0
['list list list ?bool',   'filter'], [[1]],                0
['list list list ?bool',   'filter'], [[[1]]],              0
['list list list ?bool',   'filter'], [[[[1]]]],            [[[[1]]]]
['list list list ?bool',   'filter'], [[[[[]]]]],           0
['list list list ?bool',   'filter'], [[[[1], [0, 1]]]],    [[[[1], [0, 1]]]]
['list (?bool |=(!@.@))',  'filter'], [[1, 0, 1]],          [[0, 1, 0]]
#▶3 key
['key={"abc": 1}~exact',   'filter'], ['abc'],              ['abc']
['key={"abc": 1}',         'filter'], ['abc'],              ['abc']
['key={"abc": 1}',         'filter'], ['ab'],               0
['key={"abc": 1}',         'filter'], [0],                  0
['key={"abc": 1}~start',   'filter'], ['a'],                ['abc']
#▶3 in
['in [abc def]',           'filter'], ['abc'],              ['abc']
['in =["a","b"]',          'filter'], ['abc'],              0
['in =["a",0]',            'filter'], ['a'],                ['a']
['in =["a",0]',            'filter'], ['0'],                0
['in =["a",0]',            'filter'], [0],                  [0]
['in =["a",0]~exact 0',    'filter'], [0],                  [0]
:let s:list=['abc', 'def', 'abc-def', 'Abc', 'dEf', 'aBc-deF', 'Ghi']
['in list ~exact',         'filter'], ['abc'],              ['abc']
['in list ~exact 1',       'filter'], ['ghi'],              ['Ghi']
['in list ~exact 1',       'filter'], ['gh'],               0
['in list ~start',         'filter'], ['gh'],               0
['in list ~start',         'filter'], ['ab'],               0
['in list ~start 0 1',     'filter'], ['ab'],               ['abc']
['in list ~start 1',       'filter'], ['gh'],               ['Ghi']
['in list ~smart',         'filter'], ['a-d'],              0
['in list ~smart',         'filter'], ['b-d'],              ['abc-def']
['in list ~smart 1',       'filter'], ['a-d'],              ['abc-def']
\function s:.getmatches(list, str, filter)
\    return filter(a:list, a:filter)
:endfunction
:let s:filter="len(v:val)>len(a:str)"
['in list ~func getmatches(. filter) 1', 'filter'], ['a'],    ['abc']
['in list ~func getmatches(. filter) 1', 'filter'], ['----'], ['abc-def']
['in list ~func getmatches(. filter) 0', 'filter'], ['----'], 0
#▶3 substitute
:let s:regex='\v.'
:let s:replacement='def'
:let s:flags='g'
['substitute/abc/"def"""', 'filter'], ['abc'],              ['def']
['substitute/abc/"def"""', 'filter'], [0],                  0
['substitute/abc/"def"g',  'filter'], ['abcabc'],           ['defdef']
['substitute/abc/"def"""', 'filter'], ['abcabc'],           ['defabc']
['substitute$regex$replacement$flags', 'filter'], ['abc'],  ['defdefdef']
#▶3 bool
['bool',                   'filter'], [[]],                 [0]
['bool',                   'filter'], [{}],                 [0]
['bool',                   'filter'], [""],                 [0]
['bool',                   'filter'], [0],                  [0]
['bool',                   'filter'], [1],                  [1]
['bool',                   'filter'], ["abc"],              [1]
['bool',                   'filter'], [[0]],                [1]
['bool',                   'filter'], [{1:2}],              [1]
#▶2 Pipes composition
['|*$"string"|*$"string"',     'filter'], ['abc'], ["'''abc'''"]
['|=string(@.@)|=string(@.@)', 'filter'], ['abc'], ["'''abc'''"]
#▶1 Checks
\function s:.ordered(str)
\    return join(sort(split(a:str, '\v.@=')), '') is a:str
:endfunction
:let s:d={}
:let s:d.list=range(4)
:let s:listname='list'
:let s:ss=1
:let s:es=2
#▶2 Function checks
['?*$"empty"', 'check'], ['abc'], 0
['?*$"empty"', 'check'], [''],    1
['?*ordered',  'check'], ['abc'], 1
['?*ordered',  'check'], ['acb'], 0
#▶2 Expression checks
['?=empty(@.@)', 'check'], ['abc'], 0
['?=empty(@.@)', 'check'], [''],    1
#▶2 Built-in checks
['func ordered',    'check'], ['abc'],              1
['func ordered',    'check'], ['acb'],              0
['eval empty(@.@)', 'check'], ['abc'],              0
['eval empty(@.@)', 'check'], [''],                 1
['bool',            'check'], [''],                 0
['bool',            'check'], [0],                  1
['bool',            'check'], [1],                  1
['bool',            'check'], [2],                  0
['isreg',           'check'], [0],                  0
['isreg',           'check'], ['\v(abc)'],          1
['isreg',           'check'], ['\v(abc'],           0
['key={"abc": 1}',  'check'], ['abc'],              1
['key={"abc": 1}',  'check'], ['ab'],               0
['key={"abc": 1}',  'check'], [0],                  0
['not bool',        'check'], [0],                  0
['not bool',        'check'], [2],                  1
['is =2',           'check'], [2],                  1
['is =2',           'check'], [[]],                 0
['value "a" is "a"','check'], [[]],                 1
['value "a" is "b"','check'], [[]],                 0
['_',               'check'], [[[[]]]],             1
['any',             'check'], [[[[]]]],             1
#▶3 in
['in [abc def]',    'check'], ['abc'],              1
['in =["a","b"]',   'check'], ['abc'],              0
['in =["a",0]',     'check'], ['a'],                1
['in =["a",0]',     'check'], ['0'],                0
['in =["a",0]',     'check'], [0],                  1
#▶4 Subscripts checks
['in d.list',         'check'], [0],                1
['in d.list',         'check'], [5],                0
['in d."list"',       'check'], [0],                1
['in d."list"',       'check'], [5],                0
['in d.''list''',     'check'], [0],                1
['in d.''list''',     'check'], [5],                0
['in d.$listname',    'check'], [0],                1
['in d.$listname',    'check'], [5],                0
['in d.(listname)',   'check'], [0],                1
['in d.(listname)',   'check'], [5],                0
['in d.list.:$ss$es', 'check'], [2],                1
['in d.list.:$ss$es', 'check'], [0],                0
['in d.list.:$ss 2',  'check'], [2],                1
['in d.list.:$ss 2',  'check'], [0],                0
['in d.list.:1 $es',  'check'], [2],                1
['in d.list.:1 $es',  'check'], [0],                0
['in d.list.:1 2',    'check'], [2],                1
['in d.list.:1 2',    'check'], [0],                0
#▶3 dict
['dict {}',                   'check'], [{}],              1
['dict {}',                   'check'], [{'a': 1}],        0
['dict {}',                   'check'], [[]],              0
['dict {abc bool}',           'check'], [{'abc': 1}],      1
['dict {abc bool}',           'check'], [{'abc': 2}],      0
['dict {/^a/ bool}',          'check'], [{'a':1, 'ab':0}], 1
['dict {/^a/ bool}',          'check'], [{'a':1, 'ab':2}], 0
['dict {/^a/ bool}',          'check'], [{'a':1, 'Ab':2}], 0
['dict {*ordered bool}',      'check'], [{'abc': 1}],      1
['dict {*ordered(.) bool}',   'check'], [{'abc': 1}],      1
['dict {*ordered bool}',      'check'], [{'bac': 1}],      0
['dict {=exists(@.@) bool}',  'check'], [{'g:': 0}],       1
['dict {=exists(@.@) bool}',  'check'], [{'g:': 2}],       0
['dict {=exists(@.@) bool}',  'check'], [{'g:+': 1}],      0
['dict {?|earg bool bool}',   'check'], [{'0': 1}],        1
['dict {?|earg bool bool}',   'check'], [{'0': 2}],        0
['dict {?|earg bool bool}',   'check'], [{'2': 1}],        0
['dict {- isreg}',            'check'], [{'a': 'abc'}],    1
['dict {- isreg}',            'check'], [{'a': '\v('}],    0
#▶3 path
:call os.mkdir('FWCdirectory')
:call os.chdir('FWCdirectory')
:call os.mkdir('dir')
:let curdir=os.path.realpath('.')
:let abcdefghi=os.path.join('abc', 'def', 'ghi')
:let dirdef   =os.path.join('dir', 'def')
:let foodef   =os.path.join('foo', 'def')
:let dirdefghi=os.path.join(dirdef, 'ghi')
:call writefile([], 'foo', 'b')
['path w',          'check'], ['foo'],              1
['path w',          'check'], ['bar'],              0
['path W',          'check'], ['foo'],              1
['path W',          'check'], ['bar'],              1
['path W',          'check'], [dirdefghi],          0
['path W',          'check'], [dirdef],             1
['path dW',         'check'], ['foo'],              0
['path dW',         'check'], ['bar'],              1
['path dW',         'check'], [dirdef],             1
['path p',          'check'], ['abc'],              1
['path p',          'check'], [abcdefghi],          1
['path p',          'check'], [dirdefghi],          1
['path p',          'check'], ['.'],                1
['path p',          'check'], ['foo'],              1
['path p',          'check'], [foodef],             0
['path fp',         'check'], ['foo'],              1
['path fp',         'check'], ['dir'],              0
['path dp',         'check'], ['foo'],              0
['path dp',         'check'], ['dir'],              1
['path dp',         'check'], [dirdefghi],          1
['path fr',         'check'], ['.'],                0
['path fr',         'check'], ['foo'],              1
['path d',          'check'], ['$HOME'],            0
['path d',          'check'], ['~'],                1
['path d',         'filter'], ['$HOME'],            [$HOME]
['path d',         'filter'], ['~'],                [$HOME]
#▶3 either
['either bool, isreg',      'check'], ['abc'],         1
['either bool, isreg',      'check'], [2],             0
['either bool, isreg',      'check'], [0],             1
['either bool, isreg bool', 'check'], [0, 2],          0
['either not bool, is=1',   'check'], [0],             0
['either not bool, is=1',   'check'], [1],             1
['either not bool, is=1',   'check'], [2],             1
#▶3 list
['list isreg',              'check'], ["['abc']"],     0
['list isreg',              'check'], [['abc']],       1
['list isreg',              'check'], [['abc', '\(']], 0
['list (isreg match /^a/)', 'check'], [['abc']],       1
['list (isreg match /^a/)', 'check'], [['a','b']],     0
#▶3 tuple
['tuple (?isreg match /^a/)', 'check'], [['a', 'b']],      0
['tuple (?isreg match /^a/)', 'check'], [['a']],           1
['tuple (?isreg match /^a/)', 'check'], [['.']],           0
['tuple (?isreg match /^a/)', 'check'], [['a\(']],         0
['tuple isreg, isreg',        'check'], [['abc', 'cba']],  1
['tuple isreg, isreg',        'check'], [['abc', '\(']],   0
['tuple isreg, isreg',        'check'], [['abc']],         0
['tuple isreg, isreg',        'check'], ['abc'],           0
['tuple bool, bool, bool',    'check'], [[0, 1, 0]],       1
['?tuple bool, bool, bool',  'filter'], [[0, 1, ""]],      0
#▶3 range
:let s:n1=-1
:let s:n2=1
['range  0   2',    'check'], ['1'],                0
['range  0   2',    'check'], [-1],                 0
['range  0   2',    'check'], [0],                  1
['range  0   2',    'check'], [1],                  1
['range  0   2',    'check'], [2],                  1
['range  0   2',    'check'], [3],                  0
['range  0  inf',   'check'], [3],                  1
['range inf inf',   'check'], [3],                  1
['range inf  2',    'check'], [-1],                 1
['range $n1 $n2',   'check'], [0],                  1
['range $n1 $n2',   'check'], [3],                  0
#▶3 haskey
:let s:k1='def'
['haskey abc',      'check'], [""],                 0
['haskey abc',      'check'], [{}],                 0
['haskey abc, def', 'check'], [{}],                 0
['haskey abc, def', 'check'], [{'abc': 1}],         0
['haskey abc, def', 'check'], [{'abc':1, 'def':1}], 1
['haskey abc',      'check'], [{'abc': 1}],         1
['haskey $k1, abc', 'check'], [{'abc': 1}],         0
['haskey $k1, abc', 'check'], [{'abc':1, 'def':1}], 1
['haskey $k1',      'check'], [{'abc': 1}],         0
['haskey $k1',      'check'], [{'def': 1}],         1
#▶3 isfunc
['isfunc',          'check'], [function('tr')],     1
['isfunc',          'check'], [function('s:Eval')], 0
['isfunc',          'check'], ['tr'],               1
['isfunc',          'check'], ['s:Eval'],           0
['isfunc 1',        'check'], [function('tr')],     1
['isfunc 1',        'check'], ['tr'],               0
['isfunc 1',        'check'], [function('s:Eval')], 0
# The following may throw an exception
['isfunc',          'check'], ['()'],               0
['isfunc',          'check'], ['g:[xx]'],           0
#▶3 match
:set magic
['match/\vb@<!a/',  'check'], ['abc'],              1
['match/\vb@<!a/',  'check'], ['bac'],              0
['match/\vb@<!a/',  'check'], [0],                  0
['match$regex',     'check'], [''],                 0
['match$regex',     'check'], ['abc'],              1
#▶3 idof
:augroup Foo | augroup END
:sign define Bar text=<>
:sign define 1 text=<>
['idof var',       'check'], [0],           0
['idof var',       'check'], ['outfile'],   0
['idof var',       'check'], ['g:outfile'], 1
['idof variable',  'check'], ['g:outfile'], 1
['idof func',      'check'], [':'],         0
['idof func',      'check'], ['e'],         0
['idof func',      'check'], ['eval'],      1
['idof func',      'check'], ['WriteFile'], 1
['idof function',  'check'], ['WriteFile'], 1
['idof opt',       'check'], ['_'],         0
['idof opt',       'check'], ['-'],         0
['idof opt',       'check'], ['bs'],        1
['idof opt',       'check'], ['backspace'], 1
['idof option',    'check'], ['backspace'], 1
['idof hl',        'check'], ['__'],        0
['idof hl',        'check'], ['/'],         0
['idof hl',        'check'], ['Title'],     1
['idof highlight', 'check'], ['Title'],     1
['idof event',     'check'], ['*'],         0
['idof event',     'check'], ['XXX'],       0
['idof event',     'check'], ['BufAdd'],    1
['idof augroup',   'check'], ['*'],         0
['idof augroup',   'check'], ['Bar'],       0
['idof augroup',   'check'], ['Foo'],       1
['idof sign',      'check'], ['*'],         0
['idof sign',      'check'], ['0'],         0
['idof sign',      'check'], ['Bar'],       1
['idof sign',      'check'], ['1'],         1
#▶3 type
['type string',     'check'], [''],                 1
['type string',     'check'], [0],                  0
['type ""',         'check'], [''],                 1
['type ""',         'check'], [0],                  0
["type ''",         'check'], [''],                 1
["type ''",         'check'], [0],                  0
['type number',     'check'], [0],                  1
['type number',     'check'], [[]],                 0
['type -0',         'check'], [0],                  1
['type -0',         'check'], [[]],                 0
['type -',          'check'], [0],                  1
['type -',          'check'], [[]],                 0
['type dictionary', 'check'], [{}],                 1
['type dictionary', 'check'], [[]],                 0
['type {}',         'check'], [{}],                 1
['type {}',         'check'], [[]],                 0
['type list',       'check'], [[]],                 1
['type list',       'check'], [""],                 0
['type []',         'check'], [[]],                 1
['type []',         'check'], [""],                 0
['type function',   'check'], [function("tr")],     1
['type function',   'check'], [function("s:Eval")], 1
['type function',   'check'], ["tr"],               0
['type **',         'check'], [function("tr")],     1
['type **',         'check'], [function("s:Eval")], 1
['type **',         'check'], ["tr"],               0
# Not checking float here: it may be absent on some setups
['type {}, []',     'check'], [{}],                 1
['type {}, []',     'check'], [[]],                 1
['type {}, []',     'check'], [""],                 0
#▶2 Check composition
['?=!empty(@.@)?=(type(@.@)==type(""))?=(@.@[0]=="a")', 'check'], ['abc'], 1
['?=!empty(@.@)?=(type(@.@)==type(""))?=(@.@[0]=="a")', 'check'], [''],    0
['?=!empty(@.@)?=(type(@.@)==type(""))?=(@.@[0]=="a")', 'check'], [[1]],   0
['?=!empty(@.@)?=(type(@.@)==type(""))?=(@.@[0]=="a")', 'check'], ['bac'], 0
#▶2 Checks and pipes composition
#▶1 Messages
:let s:_messages={}
:let s:_messages.str='%s<'
['#str(%) bool',                         'check'], [2],        0
['#str(%) bool (type "" #str(.) isreg)', 'check'], [1, '\v('], 0
['#str(*$"type"(@)) bool',               'check'], [2],        0
['#str(*$"type"(@)) bool',               'check'], [''],       0
['#str(%) ?_ #^ bool',                   'check'], [''],       0
['#str(%) ?_ ## bool',                   'check'], [''],       0
['#str(%) #str(.) #^ bool',              'check'], [''],       0
['#str(%) #str(.) ## bool',              'check'], [''],       0
#▶1 Option `only'
['-(only) isreg',                        'check'], '\v(',      0
['-(only) isreg',                        'check'], '\v(.)',    1
['-(only) tuple bool, isreg',            'check'], '',         0
['-(only) tuple bool, isreg',            'check'], [0],        0
['-(only) tuple bool, isreg',            'check'], [2, ''],    0
['-(only) tuple bool, isreg',            'check'], [1, '\v('], 0
['-(only) tuple bool, isreg',            'check'], [1, '_'],   1
['-(only) |bool is =1',                  'check'], [],         0
['-(only) |bool is =1',                  'check'], [1],        1
['-(only) bool',                        'filter'], [],         0
['-(only) bool',                        'filter'], [1],        1
#▶1 Option `onlystrings'
['-onlystrings (earg ?bool)',           'filter'], ['0'],      [0]
['-onlystrings (earg ?bool)',           'filter'], ['[]'],     0
['-onlystrings bool',                    'check'], ['0'],      1
['-onlystrings bool',                    'check'], ['1'],      1
['-onlystrings bool',                    'check'], ['2'],      0
['-onlystrings bool',                   'filter'], ['0'],      [0]
['-onlystrings bool',                   'filter'], ['1'],      [1]
['-onlystrings bool',                   'filter'], ['2'],      [0]
['-onlystrings bool',                   'filter'], ['yes'],    [1]
['-onlystrings bool',                   'filter'], ['ok'],     [1]
['-onlystrings bool',                   'filter'], ['tRuE'],   [1]
['-onlystrings range 0 inf',             'check'], ['-1'],     0
['-onlystrings range 0 inf',             'check'], ['+1'],     1
['-onlystrings range 0 inf',            'filter'], ['-1'],     0
['-onlystrings range 0 inf',            'filter'], ['+1'],     [1]
#▶1 Optional arguments
['bool [bool] [bool bool bool]',         'check'], [0, 2],       0
['bool [bool] [bool bool bool]',         'check'], [0, 0, 2, 0], 0
['[bool] [is=2]',                        'check'], [],           1
['[bool] [is=2]',                        'check'], [0],          1
['[bool] [is=2]',                        'check'], [1],          1
['[bool] [is=2]',                        'check'], [2],          1
['[bool] [is=2]',                        'check'], [3],          0
['type {} [key @<]',                     'check'], [{'a':1},'a'],1
['[:=(2) bool]',                        'filter'], [],           [2]
['[:=(2) bool [:=(3) bool]]',           'filter'], [],           [2, 3]
['[:=(2) bool [:=(3) bool]]',           'filter'], [0],          [0, 3]
['[:=(2) bool [:=(3) bool]]',           'filter'], [0, 1],       [0, 1]
#▶2 Complex length checks
['bool bool [bool]',                    'filter'], [0, {}, {}],  [0, 0, 0]
['bool [bool bool]',                    'filter'], [0, {}, {}],  [0, 0, 0]
['bool [bool [bool]]',                  'filter'], [0, {}, {}],  [0, 0, 0]
['bool [bool [bool]]',                  'filter'], [0, {}],      [0, 0]
['bool [bool [bool]]',                  'filter'], [0],          [0]
['bool [bool bool]',                    'filter'], [0, {}],      0
['bool [bool [bool bool]]',             'filter'], [0],          [0]
['bool [bool [bool bool]]',             'filter'], [0, 0],       [0, 0]
['bool [bool [bool bool]]',             'filter'], [0, 0, 0],    0
['bool [bool [bool bool]]',             'filter'], [0, 0, 0, 0], [0, 0, 0, 0]
['bool [bool] [bool bool bool]',         'check'], [0],          1
['bool [bool] [bool bool bool]',         'check'], [0, 0],       1
['bool [bool] [bool bool bool]',         'check'], [0, 0, 0],    0
['bool [bool] [bool bool bool]',         'check'], [0, 0, 0, 0], 1
#▶1 Next arguments
['+ bool',                              'filter'], [2, {}, 4],   [1, 0, 1]
['+ bool',                              'filter'], [],           []
['+ bool',                               'check'], [0, {}, 4],   0
['+ bool',                               'check'], [0, 1, 0],    1
['[isreg]+bool',                         'check'], ['', 1, 1],   1
['[isreg]+bool',                         'check'], ['\v(', 1],   0
['[isreg]+bool',                         'check'], ['', 2],      0
['[isreg]+bool',                         'check'], [1, 0],       1
['[isreg]+bool',                         'check'], [],           1
['[isreg]+bool',                         'check'], [''],         1
#▶1 Actions
['<abc (bool) def (bool bool) ghi (isreg)>', 'filter'], ['a', 2],  ['abc', 1]
['<abc (bool) def (bool bool) ghi (isreg)>', 'filter'], ['d', 2],  0
['<abc (bool) def (bool bool) ghi (isreg)>', 'filter'], ['g', ''], ['ghi', '']
['<abc (bool) def (bool bool) - (isreg)>',   'filter'], ['a', 2],  ['abc', 1]
['<abc (bool) def (bool bool) - (isreg)>',   'filter'], ['d', 2],  0
['<abc (bool) def (bool bool) - (isreg)>',   'filter'], ['g', ''], 0
['<abc (bool) def (bool bool) - (isreg)>',   'filter'], ['g'],     ['g']
['<abc (bool) def (bool bool) - (isreg)>',   'filter'], ['\v('],   0
['<abc (bool) def (bool bool) - (isreg)>',   'filter'], ['b', ''], 0
['<~smart abc (bool)>',                      'filter'], ['b', ''], ['abc', 0]
#▶1 Prefixes
['{abc bool}',                    'filter'], ['a', {}],   [{'abc': 0}]
['{abc bool}',                    'filter'], ['b', {}],   0
['{abc :=(2) bool}',              'filter'], ['a', {}],   [{'abc': 0}]
['{abc :=(2) bool}',              'filter'], [],          [{'abc': 2}]
['{!abc !def :=(2)}',             'filter'], ['a'],       [{'abc': 1, 'def': 2}]
['{!abc !def :=(2)}',             'filter'], ['noa'],     [{'abc': 0, 'def': 2}]
['{!abc}',                        'filter'], ['a'],       [{'abc': 1}]
['{!abc}',                        'filter'], ['noa'],     [{'abc': 0}]
['{!?abc}',                       'filter'], ['a'],       [{'abc': 1}]
['{!?abc}',                       'filter'], ['noa'],     [{'abc': 0}]
['{!?abc}',                       'filter'], [],          [{}]
['{!+2 abc bool bool}',           'filter'], ['a',2,3],   [{'abc': [1, 1]}]
['{!+2 abc bool bool}',           'filter'], ['noa'],     [{'abc': 0}]
['{abc isreg}',                   'filter'], ['a','\v('], 0
['{!abc !abd}',                   'filter'], ['a', 'a'],  0
['{abc :=(2) -}',                 'filter'], ['a'],       [{'abc': 1}]
['{abc :=(2) -}',                 'filter'], [],          [{'abc': 2}]
['{abc :=(2) -}',                 'filter'], ['noa'],     0
['{?text - ?texthl -}',           'filter'], ['text'],    [{'text': 1}]
['{abc bool ?def bool}',          'filter'], ['def', {}], 0
['{*b isreg !?a}', 'filter'], ['b', 'n', 'n'], [{'b': ['n'], 'a': 0}]
['{*b isreg !?a}', 'filter'], ['b', 'n', 'c'], [{'b': ['n', 'c']}]
#▶1 Required, optional, actions, prefixes and next composition
['{ab bool ?de bool} <gh ->', 'filter'], ['a', 0],          0
['{ab bool ?de bool} <gh ->', 'filter'], ['a', 0, 'g'],     [{'ab': 0}, 'gh']
['{ab bool ?de bool} <gh ->', 'filter'], ['a',0,'d',2,'g'], [{'ab': 0,'de': 1}, 'gh']
['{?ab isreg} <cd bool>',     'filter'], ['c', '\v('],      [{}, 'cd', 1]
['{?ab isreg} <ab bool>',     'filter'], ['a', '\v('],      [{}, 'ab', 1]
['{?ab isreg} + type string', 'filter'], ['a', '\v('],      [{}, 'a', '\v(']
['{?ab isreg} + type string', 'filter'], ['a', '\v'],       [{'ab': '\v'}]
['<a {abc isreg} b [isreg]>', 'filter'], ['a', 'abc', ''],  ['a', {'abc': ''}]
['<a {abc isreg} b [isreg]>', 'filter'], ['b'],             ['b']
['<a {abc isreg} b [isreg]>', 'filter'], ['b', ''],         ['b', '']
['type "" [type -0] {ab isreg} + type [] <cd bool>', 'filter'], ['', 0, 'a', '-', [1], 'c', {}], ['', 0, {'ab': '-'}, [1], 'cd', 0]
['<a ([:=(0) bool] {?!ab})>', 'filter'], ['a', 0], ['a', 0, {}]
['<a ([:=(0) bool] {?!+1 ab isreg})>', 'filter'], ['a', 0], ['a', 0, {}]
['<a ([:=(0) bool] {ab :=(-1) bool !+1 cd :=(-1) bool})>', 'filter'], ['a', 0], ['a', 0, {'cd': -1, 'ab': -1}]
['<a ([:=(0) bool]) b ([:=(1) bool])>', 'filter'], ['b'], ['b', 1]
# vim: cms=#%s fmr=▶,▲
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.