[PATCH 2/3 v2] test: Add tests for `notmuch-show-clean-address'.

2012-01-10 Thread David Edmondson
On Tue, 10 Jan 2012 07:06:58 -0400, David Bremner  wrote:
> On Fri, 30 Dec 2011 09:39:37 +, David Edmondson  wrote:
> > ---
> > 
> > Added backslash test. UTF8 round-trip still isn't right.
> > 
> 
> Do you mind explaining a bit better in the commit message what the issue
> is here?

I'm not completely sure.

The expected output file is supposed to contain some UTF8 encoded
text. One of the addresses to be tested has a 'human readable' part that
has the same UTF8 text. Testing the functions directly within emacs
retains the text correctly encoded. Pushing the text through the test
suite results in text that does not correctly match the expected
output.

There are many places where things could be wrong:
  - the expected output file doesn't include the correct UTF8 text
(but it looks fine in emacs),
  - the test wrapper script doesn't correctly pass around the UTF8
encoded text,
  - the emacs reader is not correctly loading the UTF8 encoded text,
  - .
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



[PATCH 2/3 v2] test: Add tests for `notmuch-show-clean-address'.

2012-01-10 Thread David Bremner
On Fri, 30 Dec 2011 09:39:37 +, David Edmondson  wrote:
> ---
> 
> Added backslash test. UTF8 round-trip still isn't right.
> 

Hi David.

Do you mind explaining a bit better in the commit message what the issue
is here?

d


Re: [PATCH 2/3 v2] test: Add tests for `notmuch-show-clean-address'.

2012-01-10 Thread David Edmondson
On Tue, 10 Jan 2012 07:06:58 -0400, David Bremner  wrote:
> On Fri, 30 Dec 2011 09:39:37 +, David Edmondson  wrote:
> > ---
> > 
> > Added backslash test. UTF8 round-trip still isn't right.
> > 
> 
> Do you mind explaining a bit better in the commit message what the issue
> is here?

I'm not completely sure.

The expected output file is supposed to contain some UTF8 encoded
text. One of the addresses to be tested has a 'human readable' part that
has the same UTF8 text. Testing the functions directly within emacs
retains the text correctly encoded. Pushing the text through the test
suite results in text that does not correctly match the expected
output.

There are many places where things could be wrong:
  - the expected output file doesn't include the correct UTF8 text
(but it looks fine in emacs),
  - the test wrapper script doesn't correctly pass around the UTF8
encoded text,
  - the emacs reader is not correctly loading the UTF8 encoded text,
  - .


pgpKuyfK3XwWl.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/3 v2] test: Add tests for `notmuch-show-clean-address'.

2012-01-10 Thread David Bremner
On Fri, 30 Dec 2011 09:39:37 +, David Edmondson  wrote:
> ---
> 
> Added backslash test. UTF8 round-trip still isn't right.
> 

Hi David.

Do you mind explaining a bit better in the commit message what the issue
is here?

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/3 v2] test: Add tests for `notmuch-show-clean-address'.

2011-12-30 Thread David Edmondson
---

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 Bar "
+"foo at bar.com "
+"?? "
+"foo (at home) "
+"foo [at home] "
+"\"Foo Bar\" "
+"Foo Bar"
+"Fred Dibna \\[extraordinaire\\] "
+   )))
+(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 000..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 home) 
+foo [at home] 
+Foo Bar 
+Foo Bar
+Fred Dibna [extraordinaire] 
-- 
1.7.7.3



[PATCH 2/3 v2] test: Add tests for `notmuch-show-clean-address'.

2011-12-30 Thread David Edmondson
---

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
+"f...@bar.com"
+""
+"Foo Bar "
+"f...@bar.com "
+"ДБ "
+"foo (at home) "
+"foo [at home] "
+"\"Foo Bar\" "
+"Foo Bar"
+"Fred Dibna \\[extraordinaire\\] "
+   )))
+(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 000..4747827
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-address-simplification
@@ -0,0 +1,10 @@
+f...@bar.com
+f...@bar.com
+Foo Bar 
+f...@bar.com
+ДБ 
+foo (at home) 
+foo [at home] 
+Foo Bar 
+Foo Bar
+Fred Dibna [extraordinaire] 
-- 
1.7.7.3

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch