Skip to content

Commit 530ca43

Browse files
committed
core/tests: pattern match instead of head
1 parent 41af101 commit 530ca43

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

hnix-store-core/tests/Fingerprint.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ spec_fingerprint = do
3232
it "allows a successful signature verification" $ do
3333
let msg = Text.encodeUtf8 $ metadataFingerprint def exampleStorePath exampleMetadata
3434
Signature sig' =
35-
head
36-
$ sig
37-
<$> filter (\(NarSignature publicKey _) -> publicKey == "cache.nixos.org-1")
38-
(Set.toList (metadataSigs exampleMetadata))
35+
case
36+
sig
37+
<$> filter (\(NarSignature publicKey _) -> publicKey == "cache.nixos.org-1")
38+
(Set.toList (metadataSigs exampleMetadata))
39+
of
40+
(x:_) -> x
41+
_ -> error "impossible"
3942
sig' `shouldSatisfy` Ed25519.verify pubkey msg
4043

4144
exampleFingerprint :: Text

0 commit comments

Comments
 (0)