ZyX_I avatar ZyX_I committed f751d91

t:fwccheck: Improved `tuple' and `list' checks tests

Comments (0)

Files changed (2)

 plugin/frawor/fwc/compiler:typefail
 plugin/frawor/fwc/compiler:ninlist
 plugin/frawor/fwc/compiler:ninlist
+::: Section <Checks/Built-in checks/list>
 plugin/frawor/fwc/compiler:typefail
 plugin/frawor/fwc/compiler:nreg
+plugin/frawor/fwc/compiler:nmatch
 ::: Section <Checks/Built-in checks/tuple>
+plugin/frawor/fwc/compiler:invlstlen
+plugin/frawor/fwc/compiler:nmatch
+plugin/frawor/fwc/compiler:nreg
 plugin/frawor/fwc/compiler:nreg
 plugin/frawor/fwc/compiler:invlstlen
 plugin/frawor/fwc/compiler:typefail

test/fwctests.dat

 ['in =["a",0]',     'check'], ['a'],                1
 ['in =["a",0]',     'check'], ['0'],                0
 ['in =["a",0]',     'check'], [0],                  1
-['list isreg',      'check'], ["['abc']"],          0
-['list isreg',      'check'], [['abc']],            1
-['list isreg',      'check'], [['abc', '\(']],      0
 ['_',               'check'], [[[[]]]],             1
 ['any',             'check'], [[[[]]]],             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, isreg', 'check'], [['abc', 'cba']],  1
-['tuple isreg, isreg', 'check'], [['abc', '\(']],   0
-['tuple isreg, isreg', 'check'], [['abc']],         0
-['tuple isreg, isreg', 'check'], ['abc'],           0
+['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
 #▶3 range
 :let s:n1=-1
 :let s:n2=1
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.