From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 16D292045D; Mon, 29 Feb 2016 08:25:59 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH 2/3] t/: try to ensure test output is stable Date: Mon, 29 Feb 2016 08:25:54 +0000 Message-Id: <20160229082555.28323-3-e@80x24.org> In-Reply-To: <20160229082555.28323-1-e@80x24.org> References: <20160229082555.28323-1-e@80x24.org> List-Id: That means we should not rely on random ordering of hashes or having auto-generated filenames in the output. This may be useful in helping people reproduce builds (not that it really matters when we do not have any binaries to distribute). --- t/all.t | 2 +- t/mda-badheaders.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/t/all.t b/t/all.t index 2d86989..8bed302 100644 --- a/t/all.t +++ b/t/all.t @@ -25,7 +25,7 @@ ok(-x $cli, "$cli is executable"); my $git_dir = "$tmp/input.git"; system(qw/git init -q --bare/, $git_dir) == 0 or die "git init -q --bare $git_dir failed: $?\n"; - ok(-d $git_dir && -f "$git_dir/config", "$git_dir exists and is bare"); + ok(-d $git_dir && -f "$git_dir/config", '$GIT_DIR exists and is bare'); # deliver the message my $simple = Email::Simple->new(<<'EOF'); diff --git a/t/mda-badheaders.t b/t/mda-badheaders.t index 40b15a9..d25c1e1 100644 --- a/t/mda-badheaders.t +++ b/t/mda-badheaders.t @@ -45,7 +45,8 @@ is(0, $?, "git cat-file returned: $?"); my $delivered = Email::Simple->new($raw); is("HIHI\n", $delivered->body, "body matches"); -while (my ($key, $val) = each %headers) { +foreach my $key (sort keys %headers) { + my $val = $headers{$key}; if ($discard{$key}) { is($delivered->header($key), undef, "header $key discarded"); } else { -- EW