[PATCH 2/3 v2] test: Add tests for `notmuch-show-clean-address'.
David Edmondson
dme at dme.org
Fri Dec 30 01:39:37 PST 2011
---
Added backslash test. UTF8 round-trip still isn't right.
test/emacs | 20 ++++++++++++++++++++
.../notmuch-address-simplification | 10 ++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
create mode 100644 test/emacs.expected-output/notmuch-address-simplification
diff --git a/test/emacs b/test/emacs
index a06c223..69738cd 100755
--- a/test/emacs
+++ b/test/emacs
@@ -514,4 +514,24 @@ counter=$(test_emacs \
)
test_expect_equal "$counter" 2
+test_begin_subtest "notmuch-show address simplification"
+test_emacs '
+(with-temp-buffer
+ (let ((input (list
+"foo at bar.com"
+"<foo at bar.com>"
+"Foo Bar <foo at bar.com>"
+"foo at bar.com <foo at bar.com>"
+"ДБ <db-uknot at stop.me.uk>"
+"foo (at home) <foo at bar.com>"
+"foo [at home] <foo at bar.com>"
+"\"Foo Bar\" <foo at bar.com>"
+"Foo Bar"
+"Fred Dibna \\[extraordinaire\\] <fred at dibna.com>"
+ )))
+ (mapc (lambda (a) (insert (notmuch-show-clean-address a) "\n")) input))
+ (test-output))
+'
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-address-simplification
+
test_done
diff --git a/test/emacs.expected-output/notmuch-address-simplification b/test/emacs.expected-output/notmuch-address-simplification
new file mode 100644
index 0000000..4747827
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-address-simplification
@@ -0,0 +1,10 @@
+foo at bar.com
+foo at bar.com
+Foo Bar <foo at bar.com>
+foo at bar.com
+ДБ <db-uknot at stop.me.uk>
+foo (at home) <foo at bar.com>
+foo [at home] <foo at bar.com>
+Foo Bar <foo at bar.com>
+Foo Bar
+Fred Dibna [extraordinaire] <fred at dibna.com>
--
1.7.7.3
More information about the notmuch
mailing list