summaryrefslogtreecommitdiff
path: root/tests/settings
diff options
context:
space:
mode:
authorJulian Mehne <julian.mehne@posteo.de>2017-12-01 15:22:01 +0100
committerJulian Mehne <julian.mehne@posteo.de>2017-12-02 00:19:37 +0100
commitf89555064a810ad7fcb3cbe079639ac3f83ff07c (patch)
tree0e362e56dcf164374693079234610e6c4106f50b /tests/settings
parent054d2a932e7cb8d18dae258750ed26fb86e650b9 (diff)
Allow regex special characters in tagstrings.
Fixes the following crashes: 1. tag completion with regex special chars :search tag:[<tab> 2. Changing tag representation of an (existing) tag with regex special chars: [tags] [[my**tag]] normal = '','', 'white','light red', 'white','#d66' 3. Contact completion with regex special chars and no external command: To:**foo<tab>
Diffstat (limited to 'tests/settings')
-rw-r--r--tests/settings/manager_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/settings/manager_test.py b/tests/settings/manager_test.py
index a09dbf15..975bcb0e 100644
--- a/tests/settings/manager_test.py
+++ b/tests/settings/manager_test.py
@@ -94,6 +94,18 @@ class TestSettingsManager(unittest.TestCase):
setting = manager.get_notmuch_setting('foo', 'bar')
self.assertIsNone(setting)
+ def test_dont_choke_on_regex_special_chars_in_tagstring(self):
+ tag = 'to**do'
+ with tempfile.NamedTemporaryFile(delete=False) as f:
+ f.write(textwrap.dedent("""\
+ [tags]
+ [[{tag}]]
+ normal = '','', 'white','light red', 'white','#d66'
+ """.format(tag=tag)))
+ self.addCleanup(os.unlink, f.name)
+ manager = SettingsManager(alot_rc=f.name)
+ manager.get_tagstring_representation(tag)
+
class TestSettingsManagerGetAccountByAddress(utilities.TestCaseClassCleanup):
"""Test the get_account_by_address helper."""