module Freckle.App.Test.Properties.PathPiece
  ( prop_roundTripPathPiece
  ) where

import Freckle.App.Prelude

import Web.PathPieces

-- | Check that @fromPathPiece (toPathPiece value)@ is @value@
prop_roundTripPathPiece :: (PathPiece a, Eq a) => a -> Bool
prop_roundTripPathPiece :: forall a. (PathPiece a, Eq a) => a -> Bool
prop_roundTripPathPiece a
a = Text -> Maybe a
forall s. PathPiece s => Text -> Maybe s
fromPathPiece (a -> Text
forall s. PathPiece s => s -> Text
toPathPiece a
a) Maybe a -> Maybe a -> Bool
forall a. Eq a => a -> a -> Bool
== a -> Maybe a
forall a. a -> Maybe a
Just a
a