diff -Nur Test-Differences-0.49_02.orig/lib/Test/Differences.pm Test-Differences-0.49_02/lib/Test/Differences.pm
--- Test-Differences-0.49_02.orig/lib/Test/Differences.pm 2008-08-02 15:00:49.000000000 +0300
+++ Test-Differences-0.49_02/lib/Test/Differences.pm 2008-12-13 16:49:41.000000000 +0200
@@ -390,6 +390,10 @@
}
}
+ for (@recs) {
+ $_ = '<undef>' unless defined
+ }
+
return \@recs;
}
diff -Nur Test-Differences-0.49_02.orig/t/20undef.t Test-Differences-0.49_02/t/20undef.t
--- Test-Differences-0.49_02.orig/t/20undef.t 1970-01-01 03:00:00.000000000 +0300
+++ Test-Differences-0.49_02/t/20undef.t 2008-12-13 16:39:13.000000000 +0200
@@ -0,0 +1,36 @@
+# Composed from F<02pass.t> and F<10test.t>
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Differences;
+
+my $warn_count;
+
+local $SIG{__WARN__} = sub {
+ $_[0] =~ m{uninitialized value in .+/Differences.pm}i and
+ $warn_count++;
+};
+
+my @r_tests = (
+ sub { eq_or_diff [ 'a', '', 'b' ], [ 'a', '', 'b' ] },
+ sub { eq_or_diff [ 'a', undef, 'b' ], [ 'a', undef, 'b' ] },
+);
+
+my @t_tests = (
+ sub { eq_or_diff [ 'a', undef, 'b' ], [ 'a', '', 'b' ] },
+ sub { eq_or_diff [ 'a', '', 'b' ], [ 'a', undef, 'b' ] },
+);
+plan tests => @r_tests + @t_tests + 1;
+
+$_->() for @r_tests;
+
+diag "This test misuses TODO: these TODOs are actually real tests.\n";
+
+TODO: {
+ local $TODO = 'Deliberate misuse of TODO';
+ $_->() for @t_tests;
+}
+
+ok !$warn_count;