tvl-depot/website/sandbox/shift-time/Spec.hs
William Carroll 5fd79ce0ff Support parsing second shifts
Parse inputs like -10s into 10 second shifts back in time.
2020-08-20 11:26:30 +01:00

17 lines
598 B
Haskell

--------------------------------------------------------------------------------
module Spec where
--------------------------------------------------------------------------------
import RIO
import Test.Hspec
import Test.QuickCheck
import Main hiding (main)
import qualified RIO.Text as Text
--------------------------------------------------------------------------------
main :: IO ()
main = hspec $ do
describe "Main" $ do
it "handles seconds" $ do
property $ \x -> parseTime (Text.concat [x & show & Text.pack, "s"]) ==
(Just defaultShiftTimeRequest { shiftSeconds = x })