packages feed

failure-detector-0: tests/Test.hs

{-# LANGUAGE ScopedTypeVariables #-}
import Data.List.NonEmpty
import Test.Tasty
import Test.Tasty.QuickCheck as QC

import Distributed.Failure.Test.Properties
import Distributed.Failure.Phi

main :: IO ()
main = defaultMain tests

tests :: TestTree
tests =
  testGroup "Phi-Acrual"
  [ QC.testProperty "Eventually dead" $
     \(Positive t) (Positive w) (Positive (i::Double)) ->
         (t > 0.3) && (i < (60*60*24*7)) ==>
                     eventuallyDead . phi t w $ (fromRational . toRational $ i) :| []
  ]