unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH 2/3] t/: try to ensure test output is stable
Date: Mon, 29 Feb 2016 08:25:54 +0000	[thread overview]
Message-ID: <20160229082555.28323-3-e@80x24.org> (raw)
In-Reply-To: <20160229082555.28323-1-e@80x24.org>

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


  parent reply	other threads:[~2016-02-29  8:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29  8:25 [ssoma PATCH 0/3] test output cleanups Eric Wong
2016-02-29  8:25 ` [PATCH 1/3] t/*.t: quiet down "git init" Eric Wong
2016-02-29  8:25 ` Eric Wong [this message]
2016-02-29  8:25 ` [PATCH 3/3] t/*: use identifiable tempdir names Eric Wong
2016-03-01  5:21 ` [PATCH] copyright updates for 2016 Eric Wong

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=20160229082555.28323-3-e@80x24.org \
    --to=e@80x24.org \
    --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.
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).