diff --git a/ChangeLog b/ChangeLog index 9f009a35a..1fb70e545 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ - TW-1705 Directories in .task/hooks should not be reported as invalid hooks (thanks to Tomas Babej). - TW-1714 Starting recurring task starts all recurrences (thanks to Robin Green). +- TW-1719 Description cannot contain improper ordinals (thanks to Ben Boeckel). - TW-1720 CmdContext uses a mix of both throw and std::cout to convey errors (thanks to Paul Beckingham). - TW-1723 task info causes segfault (thanks to Roman Golovin). diff --git a/src/Dates.cpp b/src/Dates.cpp index 3bda2508b..a0b5035c2 100644 --- a/src/Dates.cpp +++ b/src/Dates.cpp @@ -440,11 +440,7 @@ bool namedDates (const std::string& name, Variant& value) value = Variant (mktime (t), Variant::type_date); } } - else - throw std::string (STRING_DATES_ORD_MISMATCH); } - else - throw std::string (STRING_DATES_MONTH_31); } else if (closeEnough ("easter", name, minimum) || diff --git a/test/add.t b/test/add.t index 9c7d8e900..e62ce052d 100755 --- a/test/add.t +++ b/test/add.t @@ -227,6 +227,22 @@ class TestBug1612(TestCase): self.assertEqual("(bar) a / (foo bar)\n", out) +class TestBug1719(TestCase): + def setUp(self): + self.t = Task() + + def test_improper_ordinals(self): + """1719: Description cannot contain improper ordinals""" + self.t("add one 1th"); + self.t("add two 23rd"); + + code, out, err = self.t("_get 1.description") + self.assertEqual("one 1th\n", out) + + code, out, err = self.t("_get 2.description") + self.assertEqual("two 23rd\n", out) + + if __name__ == "__main__": from simpletap import TAPTestRunner unittest.main(testRunner=TAPTestRunner())