From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A902A1F5B7 for ; Sun, 14 Jun 2020 00:25:06 +0000 (UTC) From: Eric Wong 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 Message-Id: <20200614002505.15384-4-e@yhbt.net> In-Reply-To: <20200614002505.15384-1-e@yhbt.net> References: <20200614002505.15384-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: ->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");