user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH 3/3] t/imapd*.t: support older Mail::IMAPClient
Date: Sun, 14 Jun 2020 00:25:05 +0000	[thread overview]
Message-ID: <20200614002505.15384-4-e@yhbt.net> (raw)
In-Reply-To: <20200614002505.15384-1-e@yhbt.net>

->has_capability on Mail::IMAPClient 3.37 (tested on CentOS 7.x)
only returned boolean values, and not the value of the capability.
---
 t/imapd-tls.t | 4 +++-
 t/imapd.t     | 6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/t/imapd-tls.t b/t/imapd-tls.t
index f81959a5..6b3e1797 100644
--- a/t/imapd-tls.t
+++ b/t/imapd-tls.t
@@ -114,7 +114,9 @@ for my $args (
 	ok(!(scalar $c->has_capability('STARTTLS')),
 		'starttls not advertised with IMAPS');
 	ok(!$c->starttls, "starttls fails");
-	ok($c->has_capability('COMPRESS'), 'compress advertised');
+	ok($c->has_capability('COMPRESS') ||
+		$c->has_capability('COMPRESS=DEFLATE'),
+		'compress advertised');
 	ok($c->compress, 'compression enabled with IMAPS');
 	ok(!$c->starttls, 'starttls still fails');
 	ok($c->noop, 'noop succeeds');
diff --git a/t/imapd.t b/t/imapd.t
index 0f48e905..aba3ed82 100644
--- a/t/imapd.t
+++ b/t/imapd.t
@@ -217,8 +217,8 @@ for my $r ('1:*', '1') {
 	is(lc($bs->bodytype), 'text', '->bodytype');
 	is(lc($bs->bodyenc), '8bit', '->bodyenc');
 }
-
-is_deeply([$mic->has_capability('COMPRESS')], ['DEFLATE'], 'deflate cap');
+ok($mic->has_capability('COMPRESS') ||
+	$mic->has_capability('COMPRESS=DEFLATE'), 'deflate cap');
 SKIP: {
 	skip 'Mail::IMAPClient too old for ->compress', 2 if !$can_compress;
 	my $c = $imap_client->new(%mic_opt);
@@ -243,7 +243,7 @@ $pi_config->each_inbox(sub {
 	my $mb = "$ng.$first_range";
 	my $uidnext = $mic->uidnext($mb); # we'll fetch BODYSTRUCTURE on this
 	ok($uidnext, 'got uidnext for later fetch');
-	is_deeply([$mic->has_capability('IDLE')], ['IDLE'], "IDLE capa $name");
+	ok($mic->has_capability('IDLE'), "IDLE capa $name");
 	ok(!$mic->idle, "IDLE fails w/o SELECT/EXAMINE $name");
 	ok($mic->examine($mb), "EXAMINE $ng succeeds");
 	ok(my $idle_tag = $mic->idle, "IDLE succeeds on $ng");

      parent reply	other threads:[~2020-06-14  0:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14  0:25 [PATCH 0/3] IMAP fixes for older systems Eric Wong
2020-06-14  0:25 ` [PATCH 1/3] testcommon: allow OR-ing module dependencies Eric Wong
2020-06-14  0:25 ` [PATCH 2/3] inboxidle: support Linux::Inotify2 1.x Eric Wong
2020-06-14  0:25 ` Eric Wong [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://public-inbox.org/README

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

  git send-email \
    --in-reply-to=20200614002505.15384-4-e@yhbt.net \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.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://80x24.org/public-inbox.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).