perl-Test-Unit/tests5.14.patch
Troy Dawson aac91b233a RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/perl-Test-Unit#c818ddca0d68563918c20050f2a901f3bea0d66a
2020-10-14 15:21:00 -07:00

38 lines
1.8 KiB
Diff

diff -up Test-Unit-0.25/t/tlib/AssertTest.pm.old Test-Unit-0.25/t/tlib/AssertTest.pm
--- Test-Unit-0.25/t/tlib/AssertTest.pm.old 2005-10-15 23:19:18.000000000 +0200
+++ Test-Unit-0.25/t/tlib/AssertTest.pm 2011-06-23 10:58:11.187560524 +0200
@@ -63,6 +63,7 @@ sub test_assert {
$self->assert($coderef, 'a', 'a');
$self->assert([]);
$self->assert([ 'foo', 7 ]);
+ my $re_foo = qr/foo/; $re_foo = "$re_foo";
$self->check_failures(
'Boolean assertion failed' => [ __LINE__, sub { shift->assert(undef) } ],
'Boolean assertion failed' => [ __LINE__, sub { shift->assert(0) } ],
@@ -70,7 +71,7 @@ sub test_assert {
'bang' => [ __LINE__, sub { shift->assert(0, 'bang') } ],
'bang' => [ __LINE__, sub { shift->assert('', 'bang') } ],
- "'qux' did not match /(?-xism:foo)/"
+ "'qux' did not match /$re_foo/"
=> [ __LINE__, sub { shift->assert(qr/foo/, 'qux') } ],
'bang' => [ __LINE__, sub { shift->assert(qr/foo/, 'qux', 'bang') } ],
'a ne b'=> [ __LINE__, sub { shift->assert($coderef, 'a', 'b') } ],
@@ -243,6 +244,7 @@ sub test_ok_equals {
sub test_ok_not_equals {
my $self = shift;
my $adder = sub { 2+2 };
+ my $re_x = qr/x/; $re_x = "$re_x";
my @checks = (
# interface is ok(GOT, EXPECTED);
q{expected 1, got 0} => [ 0, 1 ],
@@ -253,7 +255,7 @@ sub test_ok_not_equals {
q{expected '', got 'foo'} => [ 'foo', '' ],
q{expected 'foo', got ''} => [ '', 'foo' ],
q{expected 5, got 4} => [ $adder, 5 ],
- q{'foo' did not match /(?-xism:x)/} => [ 'foo', qr/x/ ],
+ qq{'foo' did not match /$re_x/} => [ 'foo', qr/x/ ],
);
my @tests = ();
while (@checks) {