This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db: Add a test for upstream functionality
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE TemplateHaskell #-} | ||
|
||
module Test.Property.Upstream | ||
( tests | ||
) where | ||
|
||
-- Test things that come from upstream packages that have at any stage gone wrong | ||
-- or for which | ||
|
||
import Cardano.Chain.Common (fromCBORTextAddress, isRedeemAddress) | ||
|
||
import Hedgehog (Property, (===), discover) | ||
import qualified Hedgehog as H | ||
import qualified Hedgehog.Gen as Gen | ||
|
||
|
||
prop_isRedeemAddress :: Property | ||
prop_isRedeemAddress = | ||
H.withTests 2 . H.property $ do | ||
addr <- H.forAll $ Gen.element | ||
[ "Ae2tdPwUPEYycJ77DaXcWEdM3jaSBg2HgmK9jT1HmBzeLJ94x8mRw33xpBM" | ||
, "Ae2tdPwUPEZ5bWquLHSYARmM5qgmCg1cjAPb7C4tVkRNQXN2BoX2Han8xKj" | ||
, "Ae2tdPwUPEZMB92JqgxAEWfXJo6Ex7wWLoS7REmh81Ue6GgsNrDNs3MeQKA" | ||
, "Ae2tdPwUPEZ43NhMYvw1bkcGnEzdDbm9QTWiRux6Xpy8sorgfSJfazneEsP" | ||
] | ||
fmap isRedeemAddress (fromCBORTextAddress addr) === Right True | ||
|
||
-- ----------------------------------------------------------------------------- | ||
|
||
tests :: IO Bool | ||
tests = H.checkParallel $$discover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters