Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1246 from input-output-hk/fix-contestation-period…
…-conversion Fix contestation period conversion in smoke test
- Loading branch information
Showing
5 changed files
with
35 additions
and
10 deletions.
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
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
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,18 @@ | ||
module Hydra.ContestationPeriodSpec where | ||
|
||
import Hydra.Prelude | ||
|
||
import Hydra.ContestationPeriod (fromDiffTime) | ||
import Test.Hspec (Spec, describe) | ||
import Test.Hspec.QuickCheck (prop) | ||
import Test.QuickCheck (getNonPositive, getPositive) | ||
import Test.QuickCheck.Instances.Time () | ||
|
||
spec :: Spec | ||
spec = do | ||
describe "fromDiffTime" $ do | ||
prop "works for diff times > 0" $ | ||
isJust . fromDiffTime . getPositive | ||
|
||
prop "fails for diff times <= 0" $ | ||
isNothing . fromDiffTime . getNonPositive |