File: fix-tests

package info (click to toggle)
haskell-nettle 0.3.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,092 kB
  • sloc: haskell: 3,237; ansic: 252; makefile: 3
file content (45 lines) | stat: -rw-r--r-- 1,550 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- a/src/Tests/HexUtils.hs
+++ b/src/Tests/HexUtils.hs
@@ -19,7 +19,7 @@
 import qualified Data.ByteString as B
 import qualified Data.Array.IArray as A
 
-readHex' :: Monad m => String -> m [Word8]
+readHex' :: MonadFail m => String -> m [Word8]
 readHex' [] = return []
 readHex' (' ':xs) = readHex' xs
 readHex' (a:' ':xs) = readHex' $ a:xs
--- a/src/Tests/VectorsHMAC.hs
+++ b/src/Tests/VectorsHMAC.hs
@@ -171,5 +171,5 @@
 
 findHmacTestVectors :: Monad m => String -> m [(B.ByteString, B.ByteString, String)]
 findHmacTestVectors key = case filter ((key == ) . fst) hmacTestVectors of
-	[] -> fail $ "unknown HMAC: " ++ key
+	[] -> error $ "unknown HMAC: " ++ key
 	l -> return $ concatMap snd l
--- a/src/Tests/Ciphers.hs
+++ b/src/Tests/Ciphers.hs
@@ -23,11 +23,11 @@
 genByteString len = liftM B.pack $ vectorOf len (choose (0,255))
 
 runEither :: (Monad m, Show e) => Either e x -> m x
-runEither (Left e) = fail $ show e
+runEither (Left e) = error $ show e
 runEither (Right x) = return x
 
 runMaybe :: (Monad m) => Maybe x -> m x
-runMaybe Nothing = fail "got nothing"
+runMaybe Nothing = error "got nothing"
 runMaybe (Just x) = return x
 
 genKey' :: KeySizeSpecifier -> Gen B.ByteString
--- a/src/Tests/VectorsHash.hs
+++ b/src/Tests/VectorsHash.hs
@@ -1199,5 +1199,5 @@
 
 findHashTestVectors :: Monad m => String -> m [(B.ByteString, String)]
 findHashTestVectors key = case filter ((key == ) . fst) hashTestVectors of
-	[] -> fail $ "unknown Hash: " ++ key
+	[] -> error $ "unknown Hash: " ++ key
 	l -> return $ concatMap snd l