[PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-29 Thread Dmitry Kurochkin
Hi Daniel.

On Sat, 28 Jan 2012 22:30:57 +0100, Daniel Schoepe  
wrote:
> Hi Dmitry,
> 
> On Tue, 24 Jan 2012 03:07, Dmitry Kurochkin  
> wrote:
> > There are some trailing whitespaces in the tests.
> 
> those are also produced by the various notmuch-hello functions, and are
> also in the existing tests. If someone is bothered by this, it should be
> fixed in a separate patch.
> 

I only meant trailing whitespaces in test/emacs file in the lines added
by the patch.  Trailing whitespaces in expected results are obviously
fine.

> > 
> > Also, please consider moving the hello sections tests to a separate file
> > (emacs-hello-sections, perhaps?).  I am worried that test/emacs file
> > becomes too big.  And we will probably add more notmuch-hello
> > section-related tests in the future.
> 
> I think it's better to split it up into more than just
> emacs-hello-sections and emacs, as there are also quite a few tests
> relating solely to, e.g., -show or -search.
> 

I think splitting emacs tests based on -hello, -show and -search views
is a good idea.  Splitting existing tests is out of scope of this
patch.  But I think it may be a good opportunity to add a new file with
-hello tests.

> Anyhow, I'll send another rebased version fixing conflicts with the
> search-interface changes.
> 

Thanks, I will try to review it soon.

Regards,
  Dmitry

> Cheers,
> Daniel


[PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-28 Thread Daniel Schoepe
Hi Dmitry.

On Sun, 29 Jan 2012 02:48, Dmitry Kurochkin  
wrote:
> I only meant trailing whitespaces in test/emacs file in the lines added
> by the patch.  Trailing whitespaces in expected results are obviously
> fine.

Ah, okay. I fixed those with delete-trailing-whitespace, but then
noticed that this also corrected some trailing whitespace in unrelated
tests, reverted that and then forgot about the trailing whitespace in my
tests by the time I responded.

> I think splitting emacs tests based on -hello, -show and -search views
> is a good idea.  Splitting existing tests is out of scope of this
> patch.  But I think it may be a good opportunity to add a new file with
> -hello tests.

You're right; I'll do that if you find other flaws in your next
review. Otherwise, I'll just put it in another patch.

Cheers,
Daniel
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



[PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-28 Thread Daniel Schoepe
Hi Dmitry,

On Tue, 24 Jan 2012 03:07, Dmitry Kurochkin  
wrote:
> There are some trailing whitespaces in the tests.

those are also produced by the various notmuch-hello functions, and are
also in the existing tests. If someone is bothered by this, it should be
fixed in a separate patch.

> 
> Also, please consider moving the hello sections tests to a separate file
> (emacs-hello-sections, perhaps?).  I am worried that test/emacs file
> becomes too big.  And we will probably add more notmuch-hello
> section-related tests in the future.

I think it's better to split it up into more than just
emacs-hello-sections and emacs, as there are also quite a few tests
relating solely to, e.g., -show or -search.

Anyhow, I'll send another rebased version fixing conflicts with the
search-interface changes.

Cheers,
Daniel
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: [PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-28 Thread Dmitry Kurochkin
Hi Daniel.

On Sat, 28 Jan 2012 22:30:57 +0100, Daniel Schoepe dan...@schoepe.org wrote:
 Hi Dmitry,
 
 On Tue, 24 Jan 2012 03:07, Dmitry Kurochkin dmitry.kuroch...@gmail.com 
 wrote:
  There are some trailing whitespaces in the tests.
 
 those are also produced by the various notmuch-hello functions, and are
 also in the existing tests. If someone is bothered by this, it should be
 fixed in a separate patch.
 

I only meant trailing whitespaces in test/emacs file in the lines added
by the patch.  Trailing whitespaces in expected results are obviously
fine.

  
  Also, please consider moving the hello sections tests to a separate file
  (emacs-hello-sections, perhaps?).  I am worried that test/emacs file
  becomes too big.  And we will probably add more notmuch-hello
  section-related tests in the future.
 
 I think it's better to split it up into more than just
 emacs-hello-sections and emacs, as there are also quite a few tests
 relating solely to, e.g., -show or -search.
 

I think splitting emacs tests based on -hello, -show and -search views
is a good idea.  Splitting existing tests is out of scope of this
patch.  But I think it may be a good opportunity to add a new file with
-hello tests.

 Anyhow, I'll send another rebased version fixing conflicts with the
 search-interface changes.
 

Thanks, I will try to review it soon.

Regards,
  Dmitry

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


Re: [PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-28 Thread Daniel Schoepe
Hi Dmitry.

On Sun, 29 Jan 2012 02:48, Dmitry Kurochkin dmitry.kuroch...@gmail.com wrote:
 I only meant trailing whitespaces in test/emacs file in the lines added
 by the patch.  Trailing whitespaces in expected results are obviously
 fine.

Ah, okay. I fixed those with delete-trailing-whitespace, but then
noticed that this also corrected some trailing whitespace in unrelated
tests, reverted that and then forgot about the trailing whitespace in my
tests by the time I responded.

 I think splitting emacs tests based on -hello, -show and -search views
 is a good idea.  Splitting existing tests is out of scope of this
 patch.  But I think it may be a good opportunity to add a new file with
 -hello tests.

You're right; I'll do that if you find other flaws in your next
review. Otherwise, I'll just put it in another patch.

Cheers,
Daniel


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


[PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-24 Thread Dmitry Kurochkin
Hi Daniel.

There are some trailing whitespaces in the tests.

Also, please consider moving the hello sections tests to a separate file
(emacs-hello-sections, perhaps?).  I am worried that test/emacs file
becomes too big.  And we will probably add more notmuch-hello
section-related tests in the future.

Regards,
  Dmitry


Re: [PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-24 Thread Dmitry Kurochkin
Hi Daniel.

There are some trailing whitespaces in the tests.

Also, please consider moving the hello sections tests to a separate file
(emacs-hello-sections, perhaps?).  I am worried that test/emacs file
becomes too big.  And we will probably add more notmuch-hello
section-related tests in the future.

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


[PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-22 Thread Daniel Schoepe
From: Daniel Schoepe 

---
 test/emacs |   37 
 test/emacs.expected-output/notmuch-hello   |4 ++-
 .../notmuch-hello-new-section  |4 ++
 .../notmuch-hello-no-saved-searches|4 ++-
 .../notmuch-hello-section-counts   |5 +++
 .../notmuch-hello-section-hidden-tag   |4 ++
 .../notmuch-hello-section-with-empty   |4 ++
 .../emacs.expected-output/notmuch-hello-with-empty |4 ++-
 8 files changed, 63 insertions(+), 3 deletions(-)
 create mode 100644 test/emacs.expected-output/notmuch-hello-new-section
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-counts
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-hidden-tag
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-with-empty

diff --git a/test/emacs b/test/emacs
index ac47b16..8b1d16c 100755
--- a/test/emacs
+++ b/test/emacs
@@ -29,6 +29,43 @@ test_emacs '(let ((notmuch-saved-searches
  (test-output))'
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches

+test_begin_subtest "User defined section with inbox tag"
+test_emacs "(let ((notmuch-hello-sections 
+   (list (lambda () (notmuch-hello-insert-searches
+ \"Test\" '((\"inbox\" . 
\"tag:inbox\")))
+   (notmuch-hello)
+   (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-new-section
+
+test_begin_subtest "User defined section with empty, hidden entry"
+test_emacs "(let ((notmuch-hello-sections 
+   (list (lambda () (notmuch-hello-insert-searches
+ \"Test-with-empty\" 
+ '((\"inbox\" . \"tag:inbox\")
+   (\"doesnotexist\" . 
\"tag:doesnotexist\"))
+ :hide-empty-searches t)
+ (notmuch-hello)
+ (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-with-empty
+
+test_begin_subtest "User defined section, unread tag filtered out"
+test_emacs "(let ((notmuch-hello-sections 
+   (list (lambda () (notmuch-hello-insert-tags-section
+ \"Test-with-filtered\"
+ :hide-tags '(\"unread\"))
+ (notmuch-hello)
+ (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-hidden-tag
+
+test_begin_subtest "User defined section, different query for counts"
+test_emacs "(let ((notmuch-hello-sections
+   (list (lambda () (notmuch-hello-insert-tags-section
+ \"Test-with-counts\"
+ :filter-count \"tag:signed\")
+ (notmuch-hello)
+ (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts
+
 test_begin_subtest "Basic notmuch-search view in emacs"
 test_emacs '(notmuch-search "tag:inbox")
(notmuch-test-wait)
diff --git a/test/emacs.expected-output/notmuch-hello 
b/test/emacs.expected-output/notmuch-hello
index 196112e..cf49cb4 100644
--- a/test/emacs.expected-output/notmuch-hello
+++ b/test/emacs.expected-output/notmuch-hello
@@ -6,9 +6,11 @@ Saved searches: [edit]

 Search: .

-[Show all tags]
+All tags: [show]

 Type a search query and hit RET to view matching threads.
Edit saved searches with the `edit' button.
   Hit RET or click on a saved search or tag name to view matching threads.
 `=' refreshes this screen. `s' jumps to the search box. `q' to quit.
+   Customize this page.
+
diff --git a/test/emacs.expected-output/notmuch-hello-new-section 
b/test/emacs.expected-output/notmuch-hello-new-section
new file mode 100644
index 000..c64d712
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-new-section
@@ -0,0 +1,4 @@
+Test: [hide]
+
+ 52 inbox  
+
diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches 
b/test/emacs.expected-output/notmuch-hello-no-saved-searches
index f4cfe49..cec0f91 100644
--- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
+++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
@@ -2,9 +2,11 @@

 Search: .

-[Show all tags]
+All tags: [show]

 Type a search query and hit RET to view matching threads.
Edit saved searches with the `edit' button.
   Hit RET or click on a saved search or tag name to view matching threads.
 `=' refreshes this screen. `s' jumps to the search box. `q' to quit.
+   Customize this page.
+
diff --git 

[PATCH v7 2/2] emacs: Tests for user-defined sections

2012-01-21 Thread Daniel Schoepe
From: Daniel Schoepe daniel.scho...@googlemail.com

---
 test/emacs |   37 
 test/emacs.expected-output/notmuch-hello   |4 ++-
 .../notmuch-hello-new-section  |4 ++
 .../notmuch-hello-no-saved-searches|4 ++-
 .../notmuch-hello-section-counts   |5 +++
 .../notmuch-hello-section-hidden-tag   |4 ++
 .../notmuch-hello-section-with-empty   |4 ++
 .../emacs.expected-output/notmuch-hello-with-empty |4 ++-
 8 files changed, 63 insertions(+), 3 deletions(-)
 create mode 100644 test/emacs.expected-output/notmuch-hello-new-section
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-counts
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-hidden-tag
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-with-empty

diff --git a/test/emacs b/test/emacs
index ac47b16..8b1d16c 100755
--- a/test/emacs
+++ b/test/emacs
@@ -29,6 +29,43 @@ test_emacs '(let ((notmuch-saved-searches
  (test-output))'
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
 
+test_begin_subtest User defined section with inbox tag
+test_emacs (let ((notmuch-hello-sections 
+   (list (lambda () (notmuch-hello-insert-searches
+ \Test\ '((\inbox\ . 
\tag:inbox\)))
+   (notmuch-hello)
+   (test-output))
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-new-section
+
+test_begin_subtest User defined section with empty, hidden entry
+test_emacs (let ((notmuch-hello-sections 
+   (list (lambda () (notmuch-hello-insert-searches
+ \Test-with-empty\ 
+ '((\inbox\ . \tag:inbox\)
+   (\doesnotexist\ . 
\tag:doesnotexist\))
+ :hide-empty-searches t)
+ (notmuch-hello)
+ (test-output))
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-with-empty
+
+test_begin_subtest User defined section, unread tag filtered out
+test_emacs (let ((notmuch-hello-sections 
+   (list (lambda () (notmuch-hello-insert-tags-section
+ \Test-with-filtered\
+ :hide-tags '(\unread\))
+ (notmuch-hello)
+ (test-output))
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-hidden-tag
+
+test_begin_subtest User defined section, different query for counts
+test_emacs (let ((notmuch-hello-sections
+   (list (lambda () (notmuch-hello-insert-tags-section
+ \Test-with-counts\
+ :filter-count \tag:signed\)
+ (notmuch-hello)
+ (test-output))
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts
+
 test_begin_subtest Basic notmuch-search view in emacs
 test_emacs '(notmuch-search tag:inbox)
(notmuch-test-wait)
diff --git a/test/emacs.expected-output/notmuch-hello 
b/test/emacs.expected-output/notmuch-hello
index 196112e..cf49cb4 100644
--- a/test/emacs.expected-output/notmuch-hello
+++ b/test/emacs.expected-output/notmuch-hello
@@ -6,9 +6,11 @@ Saved searches: [edit]
 
 Search: .
 
-[Show all tags]
+All tags: [show]
 
 Type a search query and hit RET to view matching threads.
Edit saved searches with the `edit' button.
   Hit RET or click on a saved search or tag name to view matching threads.
 `=' refreshes this screen. `s' jumps to the search box. `q' to quit.
+   Customize this page.
+
diff --git a/test/emacs.expected-output/notmuch-hello-new-section 
b/test/emacs.expected-output/notmuch-hello-new-section
new file mode 100644
index 000..c64d712
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-new-section
@@ -0,0 +1,4 @@
+Test: [hide]
+
+ 52 inbox  
+
diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches 
b/test/emacs.expected-output/notmuch-hello-no-saved-searches
index f4cfe49..cec0f91 100644
--- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
+++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
@@ -2,9 +2,11 @@
 
 Search: .
 
-[Show all tags]
+All tags: [show]
 
 Type a search query and hit RET to view matching threads.
Edit saved searches with the `edit' button.
   Hit RET or click on a saved search or tag name to view matching threads.
 `=' refreshes this screen. `s' jumps to the search box. `q' to quit.
+   Customize this page.
+
diff --git a/test/emacs.expected-output/notmuch-hello-section-counts