Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Nov 1, 2024
1 parent 10f5d3c commit 9814b41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions hnix-store-readonly/hnix-store-readonly.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ test-suite readonly
, bytestring
, crypton
, data-default-class
, dependent-sum
, hspec
, unordered-containers
11 changes: 8 additions & 3 deletions hnix-store-readonly/tests/ReadOnlySpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import Test.Hspec (Spec, describe, it, shouldBe, pendingWith)

import Crypto.Hash (hash, Digest, SHA256(..))
import Data.ByteString (ByteString)
import Data.Dependent.Sum (DSum(..))
import System.Nix.Hash (HashAlgo(..))
import System.Nix.StorePath (StorePath, StorePathName)
import System.Nix.Store.Types (FileIngestionMethod(..))

Expand All @@ -18,6 +20,9 @@ import System.Nix.Store.ReadOnly
testDigest :: Digest SHA256
testDigest = Crypto.Hash.hash @ByteString "testDigest"

testDigest' :: DSum HashAlgo Digest
testDigest' = HashAlgo_SHA256 :=> testDigest

testName :: StorePathName
testName =
either undefined id
Expand Down Expand Up @@ -45,7 +50,7 @@ spec = do
$ makeStorePath
def
"test"
testDigest
testDigest'
testName
)
`shouldBe`
Expand Down Expand Up @@ -86,7 +91,7 @@ spec = do
$ makeFixedOutputPath
def
FileIngestionMethod_FileRecursive
testDigest
testDigest'
testName
)
`shouldBe`
Expand All @@ -99,7 +104,7 @@ spec = do
$ makeFixedOutputPath
def
FileIngestionMethod_Flat
testDigest
testDigest'
testName
)
`shouldBe`
Expand Down

0 comments on commit 9814b41

Please sign in to comment.