mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-11-23 20:56:20 +03:00
32 lines
844 B
Haskell
32 lines
844 B
Haskell
module StorePathSpec where
|
|
|
|
import Test.Hspec (Spec, describe)
|
|
import Test.Hspec.QuickCheck (prop)
|
|
import Test.Hspec.Nix (roundtrips)
|
|
|
|
import System.Nix.Arbitrary ()
|
|
import System.Nix.StorePath
|
|
|
|
import qualified Data.Attoparsec.Text
|
|
|
|
spec :: Spec
|
|
spec = do
|
|
describe "StorePath" $ do
|
|
prop "roundtrips using parsePath . storePathToRawFilePath" $
|
|
\storeDir ->
|
|
roundtrips
|
|
(storePathToRawFilePath storeDir)
|
|
(parsePath storeDir)
|
|
|
|
prop "roundtrips using parsePathFromText . storePathToText" $
|
|
\storeDir ->
|
|
roundtrips
|
|
(storePathToText storeDir)
|
|
(parsePathFromText storeDir)
|
|
|
|
prop "roundtrips using pathParser . storePathToText" $
|
|
\storeDir ->
|
|
roundtrips
|
|
(storePathToText storeDir)
|
|
(Data.Attoparsec.Text.parseOnly $ pathParser storeDir)
|