12 Commits

Author SHA1 Message Date
Tony Zorman
ebe1b9b036 X.P.OrgMode: Add ability to specify time spans 2024-03-29 20:47:52 +01:00
Tony Zorman
d691d25d1c X.P.OrgMode: Fallback to "today" if no day is given 2024-03-29 13:57:27 +01:00
Tony Zorman
1c6ae39fc9 X.P.OrgMode: Also parse time in HHMM format 2022-11-10 11:50:28 +01:00
Tony Zorman
c701a75002 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.
2022-08-28 07:41:08 +02:00
Tony Zorman
4d11a372c9 tests/OrgMode: Generate arbitrary priorities
Add the trivial Arbitrary instance for Priority, extend the Arbitrary
instance of OrgMsg, as well as some plumbing.  Also work in some unit
tests for regression testing.
2022-08-23 18:49:38 +02:00
Tony Zorman
68b5a12f96 X.P.OrgMode: Add ability to specify priorities
Add the ability to specify alphabetic (`#A`, `#B`, and `#C`) org-mode
priorities[1] at the end of the input note.

[1]: https://orgmode.org/manual/Priorities.html
2022-08-23 18:47:03 +02:00
slotThe
324fdd802a tests: Fix typos in prop names 2022-01-03 08:59:41 +01:00
slotThe
2e74c62be7 tests: Check for inverse semigroup property in OrgMode parser
Ever since [1] we allow a second representation for the month (namely,
the numerical one).  Since we lose this information during parsing,
pretty printing is now not a proper postinverse of parsing (it still is
a proper preinverse, however).

Thus, we can't simply check for an inverse anymore.  However, the
operations still form an inverse semigroup [2], which is something
that's easily checkable.  For simplicity, do this in both directions and
completely forget about linearity for now.

[1]: 91f1a0de1e4a536e6c81a3de96e566622b3eb20a (Fix date parsing issue
                                               for org mode plugin)
[2]: https://en.wikipedia.org/wiki/Inverse_semigroup
2021-12-31 09:55:49 +01:00
Sibi Prabakaran
91f1a0de1e
Fix date parsing issue for org mode plugin
This patch fixes the date parsing issue currently when an entry like
`todo +d 22 01 2022` is used. I have added tests too which demonstrate
the current issue so that we can prevent future regression.
2021-12-29 14:58:46 +05:30
slotThe
e4b8b1f6f2 Tests: Add tests for OrgMode regressions
Add regression tests to make sure we keep the behaviour fixed by
97aeaf11c10a0f38b4cd1df4726a10bb9188f4ca.

Related: https://github.com/xmonad/xmonad-contrib/issues/584
2021-08-11 07:11:54 +02:00
Tomas Janousek
c5654c47ba tests: Show counterexamples for test failures in OrgMode 2021-08-07 15:25:35 +01:00
slotThe
cfc793e94f tests: Add OrgMode
Adds a pretty-printer, as well as property tests that this is in fact
an proper inverse for the parser.
2021-06-13 19:52:48 +02:00