Add some test cases for glob with leading "./".

This commit is contained in:
Dillon Kearns 2024-04-25 09:51:27 -07:00
parent f80c7e48f8
commit 878c5eda17

View File

@ -53,6 +53,27 @@ all =
}
]
}
, globTestCase
{ name = "5 with leading ./"
, glob =
Glob.succeed
(\first second wildcardPart ->
{ first = first
, second = second
, wildcard = wildcardPart
}
)
|> Glob.match (Glob.literal "./")
|> Glob.capture (Glob.literal "glob-test-cases/")
|> Glob.capture (Glob.literal "content1/")
|> Glob.capture Glob.wildcard
, expected =
[ { first = "glob-test-cases/"
, second = "content1/"
, wildcard = "about.md"
}
]
}
, globTestCase
{ name = "capture"
, glob =
@ -61,6 +82,15 @@ all =
|> Glob.match (Glob.literal ".md")
, expected = [ "README" ]
}
, globTestCase
{ name = "capture with leading ./"
, glob =
Glob.succeed identity
|> Glob.match (Glob.literal "./")
|> Glob.capture Glob.wildcard
|> Glob.match (Glob.literal ".md")
, expected = [ "README" ]
}
, globTestCase
{ name = "oneOf"
, glob =