X.P.OrgMode: Require whitespace before priority

By being a bit less greedy with consuming whitespace in the date/time
parsers, we can make the `prop_{encode,decode}Preservation` properties
well-defined again.
This commit is contained in:
Tony Zorman
2022-08-28 07:33:58 +02:00
parent f77fb802eb
commit c701a75002
2 changed files with 30 additions and 15 deletions

View File

@@ -57,6 +57,13 @@ spec = do
B
)
context "no priority#b" $ do
it "parses to the correct thing" $
pInput "no priority#b"
`shouldBe` Just (NormalMsg "no priority#b" NoPriority)
it "encode" $ prop_encodePreservation (OrgMsg "no priority#b")
it "decode" $ prop_decodePreservation (NormalMsg "no priority#b" NoPriority)
context "+d +d f" $ do
it "encode" $ prop_encodePreservation (OrgMsg "+d +d f")
it "decode" $ prop_decodePreservation (Deadline "+d" (Time {date = Next Friday, tod = Nothing}) NoPriority)