------------------------------------------------------------------------------
dontSerializeClearText :: Assertion
dontSerializeClearText = do
  let s = encode (A.ClearText "passwordisnthamster")
  -- Take the length of the ByteString to force it completely, rather than
  -- using deepseq; BSL.ByteString lacked an NFData instance until
  -- bytestring-0.10.
  r <- try $ evaluate (BSL.length s) >> return s
  case r of
    Left  e -> (e :: SomeException) `seq` return ()
    Right j -> assertFailure $
               "Failed to reject ClearText password serialization: "
               ++ show j
 
------------------------------------------------------------------------------
dontSerializeClearText :: Assertion
dontSerializeClearText = do
  let s = encode (A.ClearText "passwordisnthamster")
  -- Take the length of the ByteString to force it completely, rather than
  -- using deepseq; BSL.ByteString lacked an NFData instance until
  -- bytestring-0.10.
  r <- try $ evaluate (BSL.length s) >> return s
  case r of
    Left  e -> (e :: SomeException) `seq` return ()
    Right j -> assertFailure $
               "Failed to reject ClearText password serialization: "
               ++ show j
 
------------------------------------------------------------------------------
dontSerializeClearText = do
  let s = encode (A.ClearText "passwordisnthamster")
  -- Take the length of the ByteString to force it completely, rather than
  -- using deepseq; BSL.ByteString lacked an NFData instance until
  -- bytestring-0.10.
  r <- try $ evaluate (BSL.length s) >> return s
  case r of
    Left  e -> (e :: SomeException) `seq` return ()
    Right j -> assertFailure $
               "Failed to reject ClearText password serialization: "
               ++ show j
 
------------------------------------------------------------------------------