2023-11-19 20:01:55 +03:00
|
|
|
module StorePathSpec where
|
|
|
|
|
2023-11-19 23:29:26 +03:00
|
|
|
import Test.Hspec (Spec, describe)
|
2023-11-19 20:01:55 +03:00
|
|
|
import Test.Hspec.QuickCheck (prop)
|
2023-11-19 23:29:26 +03:00
|
|
|
import Test.Hspec.Nix (roundtrips)
|
2023-11-19 20:01:55 +03:00
|
|
|
|
|
|
|
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" $
|
2023-11-19 23:29:26 +03:00
|
|
|
\storeDir ->
|
|
|
|
roundtrips
|
|
|
|
(storePathToRawFilePath storeDir)
|
|
|
|
(parsePath storeDir)
|
2023-11-19 20:01:55 +03:00
|
|
|
|
|
|
|
prop "roundtrips using parsePathFromText . storePathToText" $
|
2023-11-19 23:29:26 +03:00
|
|
|
\storeDir ->
|
|
|
|
roundtrips
|
|
|
|
(storePathToText storeDir)
|
|
|
|
(parsePathFromText storeDir)
|
2023-11-19 20:01:55 +03:00
|
|
|
|
|
|
|
prop "roundtrips using pathParser . storePathToText" $
|
2023-11-19 23:29:26 +03:00
|
|
|
\storeDir ->
|
|
|
|
roundtrips
|
|
|
|
(storePathToText storeDir)
|
|
|
|
(Data.Attoparsec.Text.parseOnly $ pathParser storeDir)
|