test: Add broken test for Emacs boolean term escaping
authorAustin Clements <amdragon@MIT.EDU>
Tue, 11 Mar 2014 22:19:53 +0000 (18:19 -0400)
committerDavid Bremner <david@tethera.net>
Tue, 25 Mar 2014 22:50:47 +0000 (19:50 -0300)
The current term escaper gets most of these right, but fails to escape
things containing Unicode "fancy quotes" or things containing
non-whitespace control characters.

test/T310-emacs.sh

index 00ae96a89aa8de2e9e79ffaa75f8aa12f4e42064..6c18bbd792db3556940d36903bf610a0a968be70 100755 (executable)
@@ -953,4 +953,16 @@ test_emacs '(notmuch-search "subject:\"search race test\" -subject:two")
 output=$(notmuch search --output=messages 'tag:search-global-race-tag')
 test_expect_equal "$output" "id:$gen_msg_id_1"
 
+test_begin_subtest "Term escaping"
+test_subtest_known_broken
+output=$(test_emacs "(mapcar 'notmuch-escape-boolean-term (list
+       \"\"
+       \"abc\`~\!@#\$%^&*-=_+123\"
+       \"(abc\"
+       \")abc\"
+       \"\\\"abc\"
+       \"\x01xyz\"
+       \"\\x201cxyz\\x201d\"))")
+test_expect_equal "$output" '("\"\"" "abc`~!@#$%^&*-=_+123" "\"(abc\"" "\")abc\"" "\"\"\"abc\"" "\"'$'\x01''xyz\"" "\"“xyz”\"")'
+
 test_done