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.
This commit is contained in:
Tomas Babej 2020-12-31 14:38:14 -05:00
parent 1a001caedd
commit 9753e22d0c
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5
2 changed files with 8 additions and 10 deletions

View file

@ -74,7 +74,7 @@ class TestBug880(TestCase):
def test_backslash_at_eol(self): def test_backslash_at_eol(self):
"""880: Backslash at end of description/annotation causes problems""" """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") code, out, err = self.t("_get 1.description")
self.assertEqual("one\\\n", out) self.assertEqual("one\\\n", out)

View file

@ -85,15 +85,13 @@ class TestUnicode(TestCase):
def test_unicode_escape2(self): def test_unicode_escape2(self):
"""Verify \\uNNNN unicode sequences""" """Verify \\uNNNN unicode sequences"""
# The following can be used to prove that \\\\ --> \. # The quotes around 'Price \u20A43' are necessarry, because otherwise
# The Python string converts \\\\ --> \\. # bash eats the \ sign and task never sees it.
# Something in the launch code converts \\ --> \. # Verify by running:
# Taskwarrior sees \. # $ echo add Price \u20A43 # \ is consumed
# # $ echo add "Price \u20A43" # \ is preserved
#code, out, err = self.t("add rc.debug.parser=2 Price \\\\u20A43") # $ echo add 'Price \u20A43' # \ is preserved
#self.tap(err) self.t(r"add 'Price \u20A43'")
self.t("add Price \\\\u20A43")
code, out, err = self.t("_get 1.description") code, out, err = self.t("_get 1.description")
self.assertEqual("Price ₤3\n", out); self.assertEqual("Price ₤3\n", out);