Hi Isaac,

> The two basic QuickCheck properties are:
>
> takeDrive x == x || makeRelative x (x `combine` y) == y
> isRelative x || y `combine` makeRelative y x == x

What is takeDrive? The haddock mentions those properties, but I can't
find any other reference to or definition of takeDrive on the page
produced by haddock, so it doesn't seem like very useful documentation
at the moment :)

One of the massive complications of a FilePath library is that Windows
has many syntaxes for drives - \?\\share\, \\share\, c:\, \ - etc - in
varying combinations of / and \ slashes with varying combinations of
meaning. Unix on the other hand has only one "drive" specifier, which
is /. As a result there are a load of functions such as takeDrive,
dropDrive etc which are internal to the library, and which get tested
(there is a #ifdef TESTING) with appropriate properties. In a couple
of places, the quickcheck properties need to depend on these drive
functions, which aren't exported - sad, but filepaths (esp on Windows)
weren't designed with a sound formal logical semantics behind them.

As it happens, in this particular case, if you give a drive which is
the first argument, and has some other curious properties, then the
condition won't hold - but only on Windows. I've modified the
properties so they now say:

-- > Windows: makeRelative x (x `combine` y) == y || takeDrive x == x
-- > Posix:   makeRelative x (x `combine` y) == y

Hopefully this will make it more clear that at least on Posix you
don't need to care.

Thanks

Neil
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to