File: TimerSpec.hs

package info (click to toggle)
haskell-hspec-core 2.11.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 656 kB
  • sloc: haskell: 8,945; makefile: 5
file content (32 lines) | stat: -rw-r--r-- 770 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module Test.Hspec.Core.TimerSpec (spec) where

import           Prelude ()
import           Helper

-- import           Test.Hspec.Core.Timer

spec :: Spec
spec = do
  describe "timer action provided by withTimer" $ do
    pass -- this test is fragile, see e.g. https://github.com/hspec/hspec/issues/352

{-
    let
      dt = 0.01
      wait = sleep (dt * 1.1)

    it "returns False" $ do
      withTimer dt $ \timer -> do
        timer `shouldReturn` False

    context "after specified time" $ do
      it "returns True" $ do
        withTimer dt $ \timer -> do
          wait
          timer `shouldReturn` True
          timer `shouldReturn` False
          wait
          wait
          timer `shouldReturn` True
          timer `shouldReturn` False
          -}