mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 04:01:51 -07:00
X.P.OrgMode: Fallback to "today" if no day is given
This commit is contained in:
@@ -56,6 +56,11 @@ spec = do
|
||||
(Time {date = Date (22, Just 1, Just 2021), tod = Just $ TimeOfDay 1 1})
|
||||
B
|
||||
)
|
||||
it "parses no day as today when given a time" $ do
|
||||
pInput "todo +s 12:00"
|
||||
`shouldBe` Just (Scheduled "todo" (Time {date = Today, tod = Just $ TimeOfDay 12 0}) NoPriority)
|
||||
pInput "todo +d 14:05 #B"
|
||||
`shouldBe` Just (Deadline "todo" (Time {date = Today, tod = Just $ TimeOfDay 14 5}) B)
|
||||
|
||||
context "no priority#b" $ do
|
||||
it "parses to the correct thing" $
|
||||
@@ -179,7 +184,7 @@ instance Arbitrary Date where
|
||||
[ pure Today
|
||||
, pure Tomorrow
|
||||
, Next . toEnum <$> choose (0, 6)
|
||||
, do d <- posInt
|
||||
, do d <- posInt `suchThat` (<= 31)
|
||||
m <- mbPos `suchThat` (<= Just 12)
|
||||
Date . (d, m, ) <$> if isNothing m
|
||||
then pure Nothing
|
||||
|
Reference in New Issue
Block a user