unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view
@ 2012-03-09  7:34 Dmitry Kurochkin
  2012-03-09  7:34 ` [PATCH 2/2] emacs: fix off-by-one error in notmuch-hello column alignment Dmitry Kurochkin
  2012-03-30 22:21 ` [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view Dmitry Kurochkin
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Kurochkin @ 2012-03-09  7:34 UTC (permalink / raw)
  To: notmuch

Currently, the column alignment in Emacs notmuch-hello is broken for
tags/queries with long names.
---
 test/emacs-hello                                   |    9 +++++++++
 .../emacs.expected-output/notmuch-hello-long-names |   18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100644 test/emacs.expected-output/notmuch-hello-long-names

diff --git a/test/emacs-hello b/test/emacs-hello
index b235e3a..9e5d045 100755
--- a/test/emacs-hello
+++ b/test/emacs-hello
@@ -44,4 +44,13 @@ test_emacs "(let ((notmuch-hello-sections
              (test-output))"
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts
 
+test_begin_subtest "Column alignment for tag/queries with long names"
+test_subtest_known_broken
+tag=a-very-long-tag # length carefully calculated for 80 characters window width
+notmuch tag +$tag '*'
+test_emacs '(notmuch-hello)
+            (test-output)'
+notmuch tag -$tag '*'
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-long-names
+
 test_done
diff --git a/test/emacs.expected-output/notmuch-hello-long-names b/test/emacs.expected-output/notmuch-hello-long-names
new file mode 100644
index 0000000..be6d2c5
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-long-names
@@ -0,0 +1,18 @@
+   Welcome to notmuch. You have 52 messages.
+
+Saved searches: [edit]
+
+	  52 inbox           52 unread    
+
+Search:                                                                     .
+
+All tags: [hide]
+
+	  52 a-very-long-tag       52 inbox                 52 unread 
+	   4 attachment             7 signed          
+
+	 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.
+      `=' to refresh this screen. `s' to search messages. `q' to quit.
+			    Customize this page.
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] emacs: fix off-by-one error in notmuch-hello column alignment
  2012-03-09  7:34 [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view Dmitry Kurochkin
@ 2012-03-09  7:34 ` Dmitry Kurochkin
  2012-03-30 22:21 ` [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view Dmitry Kurochkin
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Kurochkin @ 2012-03-09  7:34 UTC (permalink / raw)
  To: notmuch

Expected results for few tests are fixed, the relevant test is
unmarked broken.
---
 emacs/notmuch-hello.el                             |    2 +-
 test/emacs-hello                                   |    1 -
 .../notmuch-hello-new-section                      |    2 +-
 .../notmuch-hello-section-with-empty               |    2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e9caade..28f39f1 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -461,7 +461,7 @@ Such a list can be computed with `notmuch-hello-query-counts'."
 		  ;; just insert `(- widest (length name))' spaces - the
 		  ;; column separator is included in the button if
 		  ;; `(equal widest (length name)'.
-		  (widget-insert (make-string (max 1
+		  (widget-insert (make-string (max 0
 						   (- widest (length name)))
 					      ? )))))
 	    (setq count (1+ count))
diff --git a/test/emacs-hello b/test/emacs-hello
index 9e5d045..be66ba4 100755
--- a/test/emacs-hello
+++ b/test/emacs-hello
@@ -45,7 +45,6 @@ test_emacs "(let ((notmuch-hello-sections
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts
 
 test_begin_subtest "Column alignment for tag/queries with long names"
-test_subtest_known_broken
 tag=a-very-long-tag # length carefully calculated for 80 characters window width
 notmuch tag +$tag '*'
 test_emacs '(notmuch-hello)
diff --git a/test/emacs.expected-output/notmuch-hello-new-section b/test/emacs.expected-output/notmuch-hello-new-section
index c64d712..6a339aa 100644
--- a/test/emacs.expected-output/notmuch-hello-new-section
+++ b/test/emacs.expected-output/notmuch-hello-new-section
@@ -1,4 +1,4 @@
 Test: [hide]
 
-	  52 inbox  
+	  52 inbox 
 
diff --git a/test/emacs.expected-output/notmuch-hello-section-with-empty b/test/emacs.expected-output/notmuch-hello-section-with-empty
index 8209fed..dc2568d 100644
--- a/test/emacs.expected-output/notmuch-hello-section-with-empty
+++ b/test/emacs.expected-output/notmuch-hello-section-with-empty
@@ -1,4 +1,4 @@
 Test-with-empty: [hide]
 
-	  52 inbox  
+	  52 inbox 
 
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view
  2012-03-09  7:34 [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view Dmitry Kurochkin
  2012-03-09  7:34 ` [PATCH 2/2] emacs: fix off-by-one error in notmuch-hello column alignment Dmitry Kurochkin
@ 2012-03-30 22:21 ` Dmitry Kurochkin
  2012-04-05 10:47   ` David Bremner
  1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Kurochkin @ 2012-03-30 22:21 UTC (permalink / raw)
  To: notmuch

Hi all.

It has been a while since these patches were posted.  They are pretty
simple, just a single line (and a single char) is changed in actual
code.  So I am going to remove the needs-review tag.

Regards,
  Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view
  2012-03-30 22:21 ` [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view Dmitry Kurochkin
@ 2012-04-05 10:47   ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2012-04-05 10:47 UTC (permalink / raw)
  To: Dmitry Kurochkin, notmuch

Dmitry Kurochkin <dmitry.kurochkin@gmail.com> writes:

> It has been a while since these patches were posted.  They are pretty
> simple, just a single line (and a single char) is changed in actual
> code.  So I am going to remove the needs-review tag.

Probably it would be better in general to tag such patches trivial from
the start (at least 2/2).

Pushed both.

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-05 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-09  7:34 [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view Dmitry Kurochkin
2012-03-09  7:34 ` [PATCH 2/2] emacs: fix off-by-one error in notmuch-hello column alignment Dmitry Kurochkin
2012-03-30 22:21 ` [PATCH 1/2] test: add broken test for long names in Emacs notmuch-hello view Dmitry Kurochkin
2012-04-05 10:47   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).