unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Leo Okawa Ericson <git@relevant-information.com>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH v3] emacs: Make notmuch-show-next-thread return nil on failure
Date: Thu, 26 May 2022 20:28:49 -0300	[thread overview]
Message-ID: <874k1b6fgu.fsf@tethera.net> (raw)
In-Reply-To: <20220505085605.8224-1-git@relevant-information.com>

Leo Okawa Ericson <git@relevant-information.com> writes:

> +test_begin_subtest "notmuch-search-show-thread returns non-nil on success"
> +test_emacs_expect_t  '(notmuch-search "id:20091117203301.GV3165@dottiness.seas.harvard.edu")
> +		      (when (notmuch-search-show-thread)
> +         		(error "Expected non-nil when successfully showing a thread"))
> +		      (when (notmuch-show-next-thread)
> +         		(error "Expected nil when there are no more threads"))
> +		      t'
> +
> +test_begin_subtest "notmuch-show-next-thread returns non-nil on success"
> +test_emacs_expect_t  '(notmuch-search "id:20091117203301.GV3165@dottiness.seas.harvard.edu")
> +		      (when (notmuch-show-next-thread)
> +         		(error "Expected non-nil when successfully showing a thread"))
> +		      (when (notmuch-show-next-thread)
> +         		(error "Expected nil when there are no more threads"))
> +		      t)'
> +

- There are some whitespace issues that git complains about (space
  before tab). That seems fixable with a judicious application of M-x
  tabify. There is also an extra space after test_emacs_expect_t.

- The tests look like there there is some over enthusiastic copy
  pasting, since both test both functions, which makes them duplicate
  tests.

- Not sure why you need to throw errors here, can't you just return t or
  nil?

- the logic of the "when" does not seem to match the string for the
  error. Are you expecting the function calls to succeed or not?

d

      parent reply	other threads:[~2022-05-26 23:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05  8:56 [PATCH v3] emacs: Make notmuch-show-next-thread return nil on failure Leo Okawa Ericson
2022-05-18 14:11 ` Leo Okawa Ericson
2022-05-26 23:28 ` David Bremner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k1b6fgu.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=git@relevant-information.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).