From 7dfff13b06f9c44e33c785088c53532cf448e528 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 14 Dec 2020 23:13:40 -0500 Subject: [PATCH] tests: Allow match for 8 bit color code in color.rules.t The test proper coloring for overdue task from an hour ago fails, even though the task is properly colored. This is because the blue color gets upgraded to blue color in 256-color scheme, and hence is represented with 38;5;4m instead of 34m. Support both representations of the blue color in the given test. --- test/color.rules.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/color.rules.t b/test/color.rules.t index efc927e91..48228c6f2 100755 --- a/test/color.rules.t +++ b/test/color.rules.t @@ -126,7 +126,8 @@ class TestColorRules(TestCase): def test_due_anhourago(self): """Overdue color rule from an hour ago.""" code, out, err = self.t('/anhourago/ info') - self.assertIn('\x1b[34m', out) + # Match 4-bit or 8-bit blue color code + self.assertRegex(out, '\x1b\[(38;5;4|34)m') def test_due_tomorrow(self): """Due tomorrow color rule."""