unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: David Bremner <david@tethera.net>
Cc: "notmuch@notmuchmail.org" <notmuch@notmuchmail.org>,
	Ludovic LANGE <ll-notmuchmail@lange.nom.fr>,
	Stefano Zacchiroli <zack@upsilon.cc>
Subject: Re: [PATCH 3/3] test: ruby: simplify basic tests
Date: Sun, 23 May 2021 17:51:40 -0500	[thread overview]
Message-ID: <CAMP44s03VO4gCVwYGSohZFVuQzvsAvCErycZpTb_bT4e4Lc4Ow@mail.gmail.com> (raw)
In-Reply-To: <87zgwlr5pw.fsf@tethera.net>

On Sun, May 23, 2021 at 7:32 AM David Bremner <david@tethera.net> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > We don't need to check for the order here, that is done in another test.
> >
> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> > ---
> >  test/T395-ruby.sh | 12 ++++--------
> >  1 file changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh
> > index e828efed..9298bc9e 100755
> > --- a/test/T395-ruby.sh
> > +++ b/test/T395-ruby.sh
> > @@ -20,21 +20,17 @@ test_ruby() {
> >  }
> >
> >  test_begin_subtest "compare thread ids"
> > -notmuch search --sort=oldest-first --output=threads tag:inbox > EXPECTED
> > +notmuch search --output=threads tag:inbox > EXPECTED
> >  test_ruby <<"EOF"
> > -q = db.query('tag:inbox')
> > -q.sort = Notmuch::SORT_OLDEST_FIRST
> > -q.search_threads.each do |t|
> > +db.query('tag:inbox').search_threads.each do |t|
> >    puts 'thread:%s' % t.thread_id
> >  end
> >  EOF
> >
>
> Is this assuming that the sort order in the CLI is the same as in the
> library / bindings? that seems a bit fragile if so.

Both the CLI and the bindings are using the same libnotmuch library.
If neither of them specify a sort order, the default sort order of
libnotmuch would be used (I presume). Exactly the same order I would
get if I write a C program that uses libnotmuch and doesn't specify
any order.

Why would the CLI specify an order the user didn't specify to libnotmuch?

-- 
Felipe Contreras

  reply	other threads:[~2021-05-23 22:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01 12:04 [PATCH 0/3] ruby: improve db.query Felipe Contreras
2021-05-01 12:04 ` [PATCH 1/3] ruby: use notmuch_exclude_t enum Felipe Contreras
2021-05-23 12:28   ` David Bremner
2021-05-01 12:04 ` [PATCH 2/3] ruby: add keyword arguments to db.query Felipe Contreras
2021-05-23 12:29   ` David Bremner
2021-05-24  2:23     ` Felipe Contreras
2021-05-01 12:04 ` [PATCH 3/3] test: ruby: simplify basic tests Felipe Contreras
2021-05-23 12:32   ` David Bremner
2021-05-23 22:51     ` Felipe Contreras [this message]
2021-06-07 23:53       ` David Bremner
2021-06-08  1:29         ` Felipe Contreras

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=CAMP44s03VO4gCVwYGSohZFVuQzvsAvCErycZpTb_bT4e4Lc4Ow@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=david@tethera.net \
    --cc=ll-notmuchmail@lange.nom.fr \
    --cc=notmuch@notmuchmail.org \
    --cc=zack@upsilon.cc \
    /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).