-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable negative match patterns
- Loading branch information
Showing
4 changed files
with
11 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,6 @@ proc createStructure (dir: string, files: seq[string]): () -> void = | |
|
||
result = () => removeDir(dir) | ||
|
||
|
||
proc seqsEqual (seq1, seq2: seq[string], ignoreCase = false): bool = | ||
if ignoreCase: | ||
seqsEqual(seq1.mapIt(toLower(it)), seq2.mapIt(toLower(it))) | ||
|
@@ -291,15 +290,12 @@ suite "regex matching": | |
check isMatchTest("*(foo|ba[rt]).nim", "baz.nim").not | ||
check isMatchTest("*(foo|ba[rt]).nim", "fun.nim").not | ||
|
||
test "extended (!) - currently unsupported": | ||
# currently unsupported in regex implementation | ||
expect GlobSyntaxError: discard globToRegexString("!(boo).txt") | ||
|
||
# check isMatchTest("!(boo).nim", "foo.nim") | ||
# check isMatchTest("!(foo|baz)bar.nim", "buzbar.nim") | ||
# check isMatchTest("!bar.nim", "!bar.nim") | ||
# check isMatchTest("!({foo,bar})baz.nim", "notbaz.nim") | ||
# check isMatchTest("!({foo,bar})baz.nim", "foobaz.nim").not | ||
test "extended (!)": | ||
check isMatchTest("!bar.nim", "!bar.nim") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
haltcase
Author
Owner
|
||
check isMatchTest("!(boo).nim", "foo.nim") | ||
check isMatchTest("!(foo|baz)bar.nim", "buzbar.nim") | ||
check isMatchTest("!({foo,bar})baz.nim", "notbaz.nim") | ||
check isMatchTest("!({foo,bar})baz.nim", "foobaz.nim").not | ||
|
||
test "extended (+)": | ||
check isMatchTest("+foo.nim", "+foo.nim") | ||
|
@citycide how about adding some negative tests, eg
check not isMatchTest...
?also, can you explain or add a doc comment for 1st example
check isMatchTest("!bar.nim", "!bar.nim")
? is!
same as!()
? this is confusing; does it match usual behavior?