Add tests

This commit is contained in:
Jeroen Engels 2024-04-07 09:23:43 +02:00
parent 4245fc1fb0
commit 078e2d0414

View File

@ -12,4 +12,26 @@ all =
\() ->
FilePattern.match [] "some/file/path.ext"
|> Expect.equal False
, test "should return True when the list contains the target file" <|
\() ->
FilePattern.match
[ FilePattern.include "some/file/path.ext"
]
"some/file/path.ext"
|> Expect.equal True
, test "should return True when the list a Glob matching a parent" <|
\() ->
FilePattern.match
[ FilePattern.include "some/file/**"
]
"some/file/path.ext"
|> Expect.equal True
, test "should return False when the list a Glob matching a parent but exclude the file itself" <|
\() ->
FilePattern.match
[ FilePattern.include "some/file/**"
, FilePattern.exclude "some/file/path.ext"
]
"some/file/path.ext"
|> Expect.equal False
]