Deewiant / glob

Haskell library for glob matching
https://deewiant.iki.fi/projects/glob/
Other
25 stars 8 forks source link

Extra slashes appearing in `commonDirectory` #18

Closed hdgarrood closed 7 years ago

hdgarrood commented 7 years ago

While working on #15 I noticed the following:

> commonDirectory (compile "foo/*/*.hs")
("foo/",compile "*//*.hs")

I was expecting to get ("foo/",compile "*/*.hs"). Is this a bug?

Deewiant commented 7 years ago

I'd say so, yes. :-)

commonDirectory seems to lack tests... I imagine that a trivial QuickCheck property along the lines of \x -> let (a, b) = commonDirectory (compile x) in x == literal a <> b would catch this.

hdgarrood commented 7 years ago

Great, okay, I'll take a crack at this one then.