From 83a55ccfe583b1387654bd3aefb68c92971d5907 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 14 Dec 2020 21:52:09 -0500 Subject: [PATCH] tests: Add test for coloring an overdue task from earlier today --- test/color.rules.t | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/test/color.rules.t b/test/color.rules.t index faeec6404..efc927e91 100755 --- a/test/color.rules.t +++ b/test/color.rules.t @@ -81,16 +81,17 @@ class TestColorRules(TestCase): cls.t('3 modify depends:4') cls.t('add tomorrow due:tomorrow') # 5 cls.t('add yesterday due:yesterday') # 6 - cls.t('add someday due:yesterday') # 7 - cls.t('add project_x project:x') # 8 - cls.t('add pri_h priority:H') # 9 - cls.t('add pri_m priority:M') # 10 - cls.t('add pri_l priority:L') # 11 - cls.t('add keyword') # 12 - cls.t('add tag_x +x') # 13 - cls.t('add uda_xxx_1 xxx:1') # 14 - cls.t('add uda_xxx_4 xxx:4') # 15 - cls.t('add recurring due:tomorrow recur:1week') # 16 # Keep this last + cls.t('add anhourago due:now-1h') # 7 + cls.t('add someday due:yesterday') # 8 + cls.t('add project_x project:x') # 9 + cls.t('add pri_h priority:H') # 10 + cls.t('add pri_m priority:M') # 11 + cls.t('add pri_l priority:L') # 12 + cls.t('add keyword') # 13 + cls.t('add tag_x +x') # 14 + cls.t('add uda_xxx_1 xxx:1') # 15 + cls.t('add uda_xxx_4 xxx:4') # 16 + cls.t('add recurring due:tomorrow recur:1week') # 17 Keep this last def test_control(self): """No color on control task.""" @@ -122,6 +123,11 @@ class TestColorRules(TestCase): code, out, err = self.t('/yesterday/ info') self.assertIn('\x1b[34m', out) + def test_due_anhourago(self): + """Overdue color rule from an hour ago.""" + code, out, err = self.t('/anhourago/ info') + self.assertIn('\x1b[34m', out) + def test_due_tomorrow(self): """Due tomorrow color rule.""" code, out, err = self.t('/tomorrow/ info')