diff options
author | Ævar Arnfjörð Bjarmason <avar@cpan.org> | 2014-06-21 17:44:20 +0000 |
---|---|---|
committer | Ævar Arnfjörð Bjarmason <avar@cpan.org> | 2014-06-21 17:58:43 +0000 |
commit | aaa63daea7f8ece57d84d8329754f95ea107301e (patch) | |
tree | 2723b291b86bd26f2190f99be6858157f2e08af1 /dist/threads | |
parent | 43d7f0da895d00d0f557ad72549ddb3194763b55 (diff) | |
download | perl-aaa63daea7f8ece57d84d8329754f95ea107301e.tar.gz |
Make like() and unlike() in t/test.pl refuse non-qr// arguments
As I noted in v5.21.1-12-g826af13 we have subtle bugs in the test suite
because you can do e.g. like($@, '') now which'll be a passing test even
when we have an error, because $@ =~ // will be true.
I'm just changing t/test.pl to not accept non-Regexp arguments, and
fixing up a bunch of test failures that resulted from that. There might
still be more of these in tests that I'm just not running, I've also
changed some of these from $str =~ /foo/ to $str eq 'foo'
(i.e. s/like/is/) in cases where that appeared to work, but it might
break some systems.
Let's just find that out via the smokers.
Diffstat (limited to 'dist/threads')
-rw-r--r-- | dist/threads/t/err.t | 2 | ||||
-rw-r--r-- | dist/threads/t/exit.t | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/dist/threads/t/err.t b/dist/threads/t/err.t index f5e0a19f82..b708823c91 100644 --- a/dist/threads/t/err.t +++ b/dist/threads/t/err.t @@ -28,7 +28,7 @@ my $result = $thr->join(); ok(! defined($result), 'thread died'); # Check error -like($thr->error(), q/Can't locate object method/, 'thread error'); +like($thr->error(), qr/^Can't locate object method/s, 'thread error'); # Create a thread that 'die's with an object diff --git a/dist/threads/t/exit.t b/dist/threads/t/exit.t index 6acad2f166..2879e2be32 100644 --- a/dist/threads/t/exit.t +++ b/dist/threads/t/exit.t @@ -121,7 +121,7 @@ my $out = run_perl(prog => 'use threads 1.92;' . local $TODO = 'VMS exit semantics not like POSIX exit semantics' if $^O eq 'VMS'; is($?>>8, 99, "exit(status) in thread"); } -like($out, '1 finished and unjoined', "exit(status) in thread"); +like($out, qr/1 finished and unjoined/, "exit(status) in thread"); $out = run_perl(prog => 'use threads 1.92 qw(exit thread_only);' . @@ -138,7 +138,7 @@ $out = run_perl(prog => 'use threads 1.92 qw(exit thread_only);' . local $TODO = 'VMS exit semantics not like POSIX exit semantics' if $^O eq 'VMS'; is($?>>8, 99, "set_thread_exit_only(0)"); } -like($out, '1 finished and unjoined', "set_thread_exit_only(0)"); +like($out, qr/1 finished and unjoined/, "set_thread_exit_only(0)"); run_perl(prog => 'use threads 1.92;' . |