Support parsing second shifts
Parse inputs like -10s into 10 second shifts back in time.
This commit is contained in:
parent
81aa32fe71
commit
5fd79ce0ff
5 changed files with 125 additions and 0 deletions
17
website/sandbox/shift-time/Spec.hs
Normal file
17
website/sandbox/shift-time/Spec.hs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
--------------------------------------------------------------------------------
|
||||
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 })
|
||||
Loading…
Add table
Add a link
Reference in a new issue