From 9753e22d0cdc06d585cf55df4680934ac6b0bfb9 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 31 Dec 2020 14:38:14 -0500 Subject: [PATCH] tests: Adjust tests enforcing incorrect behaviour In 1a001cae, double json-decoding of the attribute values was removed, and as such we need to adjust tests to actually enforce correct behaviour. --- test/quotes.t | 2 +- test/unicode.t | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/test/quotes.t b/test/quotes.t index e99f0330c..7c49d9f09 100755 --- a/test/quotes.t +++ b/test/quotes.t @@ -74,7 +74,7 @@ class TestBug880(TestCase): def test_backslash_at_eol(self): """880: Backslash at end of description/annotation causes problems""" - self.t("add one\\\\\\\\") + self.t(r"add one\\") code, out, err = self.t("_get 1.description") self.assertEqual("one\\\n", out) diff --git a/test/unicode.t b/test/unicode.t index 8f7df41de..a2ee61282 100755 --- a/test/unicode.t +++ b/test/unicode.t @@ -85,15 +85,13 @@ class TestUnicode(TestCase): def test_unicode_escape2(self): """Verify \\uNNNN unicode sequences""" - # The following can be used to prove that \\\\ --> \. - # The Python string converts \\\\ --> \\. - # Something in the launch code converts \\ --> \. - # Taskwarrior sees \. - # - #code, out, err = self.t("add rc.debug.parser=2 Price \\\\u20A43") - #self.tap(err) - - self.t("add Price \\\\u20A43") + # The quotes around 'Price \u20A43' are necessarry, because otherwise + # bash eats the \ sign and task never sees it. + # Verify by running: + # $ echo add Price \u20A43 # \ is consumed + # $ echo add "Price \u20A43" # \ is preserved + # $ echo add 'Price \u20A43' # \ is preserved + self.t(r"add 'Price \u20A43'") code, out, err = self.t("_get 1.description") self.assertEqual("Price ₤3\n", out);