path-extra 0.3.0 → 0.3.1
raw patch · 3 files changed
+8/−10 lines, 3 files
Files
- path-extra.cabal +2/−2
- src/Path/Extended.hs +2/−2
- test/Spec.hs +4/−6
path-extra.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 960287c20bb6f39c6a9ae6c22985774c943b509f75dfa7674b2b2c9c4b6951ac+-- hash: 552bb5afa168a001a775ec2384529a0909290298efd15fc11c3f3bef78d322c3 name: path-extra-version: 0.3.0+version: 0.3.1 synopsis: URLs without host information description: Please see the README on Github at <https://github.com/athanclark/path-extra#readme> category: System, Filesystem, Web
src/Path/Extended.hs view
@@ -76,14 +76,14 @@ data LocationPath base = Dir (Path base Dir) | File (Path base File)- deriving (Eq, Ord, Generic)+ deriving (Eq, Ord, Generic, Show) -- | A location for some base and type - internally uses @Path@. data Location base = Location { locPath :: LocationPath base , locQueryParams :: [QueryParam] , locFragment :: Maybe String- } deriving (Eq, Ord, Generic)+ } deriving (Eq, Ord, Generic, Show)
test/Spec.hs view
@@ -8,7 +8,7 @@ module Main where import Path (parseAbsDir, parseAbsFile, Path, Abs, Dir, File)-import Path.Extended (Location (..), QueryParam, locationParser, printLocation)+import Path.Extended (Location (..), QueryParam, locationAbsParser, printLocation, LocationPath (..)) import qualified Data.Text as T import Data.Monoid ((<>))@@ -25,12 +25,12 @@ newtype ArbitraryLocation = ArbitraryLocation- { getArbitraryLocation :: Location+ { getArbitraryLocation :: Location Abs } deriving (Eq, Show) instance Arbitrary ArbitraryLocation where arbitrary = do- locPath <- oneof [Left <$> arbitraryAbsDir, Right <$> arbitraryAbsFile]+ locPath <- oneof [Dir <$> arbitraryAbsDir, File <$> arbitraryAbsFile] locQueryParams <- arbitraryQueryParams locFragment <- arbitraryFragment pure $ ArbitraryLocation Location@@ -89,12 +89,10 @@ Right path -> path -deriving instance Show Location - printParseIso :: ArbitraryLocation -> Bool printParseIso (ArbitraryLocation loc) =- Right loc == parseOnly locationParser (printLocation loc)+ Right loc == parseOnly locationAbsParser (printLocation loc)