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-ASN: 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 0BB1B1F461; Tue, 25 Jun 2019 03:48:43 +0000 (UTC) Date: Tue, 25 Jun 2019 03:48:42 +0000 From: Eric Wong To: meta@public-inbox.org Cc: "Eric W. Biederman" Subject: Re: [PATCH] msgmap: mid_insert: use plain "INSERT" to detect duplicates Message-ID: <20190625034842.aarimkv7hn573b5e@dcvr> References: <878strvusz.fsf@xmission.com> <20190624233809.1721-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190624233809.1721-1-e@80x24.org> List-Id: Pushed to `master' with this warning fix squashed in since I used `$max' elsewhere: diff --git a/t/msgmap.t b/t/msgmap.t index 2d018219..20985ce8 100644 --- a/t/msgmap.t +++ b/t/msgmap.t @@ -30,8 +30,8 @@ $@ = undef; my $ret = $d->mid_insert('a@b'); is($ret, undef, 'duplicate mid_insert in undef result'); is($d->num_for('a@b'), $mid2num{'a@b'}, 'existing number not clobbered'); -my $max = (sort(keys %num2mid))[-1]; -is($d->mid_insert('ok@unique'), $max + 1, +my $next = (sort(keys %num2mid))[-1]; +is($d->mid_insert('ok@unique'), $next + 1, 'got expected num after failing mid_insert');