From: Vincent Pit Date: Mon, 12 Jan 2009 18:05:07 +0000 (+0100) Subject: In t/85-stress-unwind.t, don't rely on is_deeply to return the result of the test X-Git-Tag: v0.05~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=df13e52b10dc5902a7f1a0b02dc7fb5eef429944;p=perl%2Fmodules%2FScope-Upper.git In t/85-stress-unwind.t, don't rely on is_deeply to return the result of the test --- diff --git a/t/85-stress-unwind.t b/t/85-stress-unwind.t index 75bad3e..5a59e7a 100644 --- a/t/85-stress-unwind.t +++ b/t/85-stress-unwind.t @@ -59,21 +59,30 @@ sub gen { return \@res; } +sub linearize { join ', ', map { defined($_) ? $_ : '(undef)' } @_ } + sub runtests { + my ($height, $level) = @_; + my $i; my $tests = gen @_; for (@$tests) { + ++$i; no warnings 'void'; - my @res = eval $_->[0]; - my @exp = eval $_->[1] unless $@; - if ($@ || !is_deeply \@res, \@exp) { - diag "=== vvv Test vvv ==="; - diag $_->[0]; - diag "------- Got --------"; - diag join(', ', map { defined($_) ? $_ : '(undef)' } @res); - diag "----- Expected -----"; - diag join(', ', map { defined($_) ? $_ : '(undef)' } @exp); - diag "=== ^^^^^^^^^^^^ ==="; + my $res = linearize eval $_->[0]; + $res = '*TEST DID NOT COMPILE*' if $@; + my $exp; + unless ($@) { + $exp = linearize eval $_->[1]; + $exp = '*REFERENCE DID NOT COMPILE*' if $@; + } + if ($@ || $res ne $exp) { + diag <[0]; +==== vvvvv Errors vvvvvv === +DIAG } + is $res, $exp, "stress unwind $height $level $i"; } }