test: add test for emacs notmuch-show-strip-re function
authorJani Nikula <jani@nikula.org>
Tue, 5 Jun 2012 15:42:50 +0000 (18:42 +0300)
committerDavid Bremner <bremner@debian.org>
Fri, 8 Jun 2012 02:26:26 +0000 (23:26 -0300)
The function is used for stripping "re:" from subjects to generate
"bare subjects". Include broken test for having "re:" in the middle of
the subject.

test/emacs-show

index 2498564f89e433328850c7e60106878a49e74566..1ddb28eb2d1ba47644c4a870ff21a4aa33d51d92 100755 (executable)
@@ -24,4 +24,17 @@ test_emacs "(notmuch-show \"id:$message_id\")
            (test-visible-output)"
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "Bare subject #1"
+output=$(test_emacs '(notmuch-show-strip-re "Re: subject")')
+test_expect_equal "$output" '"subject"'
+
+test_begin_subtest "Bare subject #2"
+output=$(test_emacs '(notmuch-show-strip-re "re:Re: re:  Re:  re:subject")')
+test_expect_equal "$output" '"subject"'
+
+test_begin_subtest "Bare subject #3"
+test_subtest_known_broken
+output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')
+test_expect_equal "$output" '"the cure: fix the regexp"'
+
 test_done