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 04D971F464; Mon, 25 Nov 2019 05:24:55 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: "Eric W. Biederman" Subject: [PATCH 1/3] t/msgtime: show date in test descriptions Date: Mon, 25 Nov 2019 05:24:52 +0000 Message-Id: <20191125052454.19950-2-e@80x24.org> In-Reply-To: <20191125052454.19950-1-e@80x24.org> References: <20191125052454.19950-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Otherwise it's hard to figure what fails. --- t/msgtime.t | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/t/msgtime.t b/t/msgtime.t index 6b396602..7bf73185 100644 --- a/t/msgtime.t +++ b/t/msgtime.t @@ -58,7 +58,7 @@ for (my $min = -1440; $min <= 1440; $min += 30) { my $date = sprintf("Fri, 02 Oct 1993 00:00:00 %s%02d%02d", $sign, $h, $m); my $result = datestamp($date); - is_deeply($result, [ $ts_expect, $tz_expect ]); + is_deeply($result, [ $ts_expect, $tz_expect ], $date); } # Verify that the parser sucks up the timezone and for received timestamps @@ -74,14 +74,19 @@ for (my $min = -1440; $min <= 1440; $min += 30) { } my $received = sprintf('Mon, 22 Jan 2007 13:16:24 %s%02d%02d', $sign, $h, $m); - is_deeply(timestamp($received), [ $ts_expect, $tz_expect ]); + is_deeply(timestamp($received), [ $ts_expect, $tz_expect ], + $received); } -is_deeply(datestamp('Wed, 13 Dec 2006 10:26:38 +1'), [1166001998, '+0100']); -is_deeply(datestamp('Fri, 3 Feb 2006 18:11:22 -00'), [1138990282, '+0000']); -is_deeply(datestamp('Thursday, 20 Feb 2003 01:14:34 +000'), [1045703674, '+0000']); -is_deeply(datestamp('Fri, 28 Jun 2002 12:54:40 -700'), [1025294080, '-0700']); -is_deeply(datestamp('Sat, 12 Jan 2002 12:52:57 -200'), [1010847177, '-0200']); -is_deeply(datestamp('Mon, 05 Nov 2001 10:36:16 -800'), [1004985376, '-0800']); +sub is_datestamp ($$) { + my ($date, $expect) = @_; + is_deeply(datestamp($date), $expect, $date); +} +is_datestamp('Wed, 13 Dec 2006 10:26:38 +1', [1166001998, '+0100']); +is_datestamp('Fri, 3 Feb 2006 18:11:22 -00', [1138990282, '+0000']); +is_datestamp('Thursday, 20 Feb 2003 01:14:34 +000', [1045703674, '+0000']); +is_datestamp('Fri, 28 Jun 2002 12:54:40 -700', [1025294080, '-0700']); +is_datestamp('Sat, 12 Jan 2002 12:52:57 -200', [1010847177, '-0200']); +is_datestamp('Mon, 05 Nov 2001 10:36:16 -800', [1004985376, '-0800']); done_testing();