Skip to content

Commit

Permalink
Failing test computing average
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-iohk committed May 4, 2021
1 parent cb15ba6 commit 3491b33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hydra-sim.cabal
Expand Up @@ -130,6 +130,8 @@ test-suite tests
, hspec
, hydra-sim -any
, QuickCheck -any
, io-sim-classes -any
, io-sim -any
build-tool-depends:
hspec-discover:hspec-discover
ghc-options:
Expand Down
10 changes: 10 additions & 0 deletions test/HydraSim/AnalyseSpec.hs
@@ -1,5 +1,7 @@
module HydraSim.AnalyseSpec where

import Control.Monad.Class.MonadTime (Time (Time))
import Control.Monad.IOSim (ThreadLabel)
import HydraSim.Analyse
import Test.Hspec

Expand All @@ -8,3 +10,11 @@ spec = describe "Analyse Simulation" $ do
describe "Average Confirmation Time" $ do
it "returns Nothing given no transaction" $ do
avgConfTime [] `shouldBe` Nothing
it "returns Nothing given no transaction is confirmed" $ do
avgConfTime [TxUnconfirmed someLabel someTime] `shouldBe` Nothing

someTime :: Time
someTime = Time 10000

someLabel :: ThreadLabel
someLabel = "thread"

0 comments on commit 3491b33

Please sign in to comment.