diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-02-04 11:32:55 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-02-04 11:32:55 +0000 |
commit | 332878e1ede268223970e2ddec708901541910d4 (patch) | |
tree | 15bc0860374dc34d581d3fd2c54b493dbcf4e4fb /ext | |
parent | b2d32ffb25539e36e18d4e4d11483f75d2b53b18 (diff) | |
download | perl-332878e1ede268223970e2ddec708901541910d4.tar.gz |
In B's tests, fix calls to like() which weren't being passed a regexp.
Now that the tests actually *test*, this reveals that one of the tests wasn't
actually correct. Fix that, and in the process make the particular error
message clearer and more consistent.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/t/OptreeCheck.pm | 2 | ||||
-rw-r--r-- | ext/B/t/concise.t | 2 | ||||
-rw-r--r-- | ext/B/t/optree_check.t | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/ext/B/t/OptreeCheck.pm b/ext/B/t/OptreeCheck.pm index 50ea85e95f..164f56122a 100644 --- a/ext/B/t/OptreeCheck.pm +++ b/ext/B/t/OptreeCheck.pm @@ -733,7 +733,7 @@ sub mkCheckRex { $str =~ s/leavesub \[\d\]/leavesub [\\d]/msg; # for -terse #$str =~ s/(\s*)\n/\n/msg; # trailing spaces - croak "no reftext found for $want: $tc->{name}" + croak "whitespace only reftext found for '$want': $tc->{name}" unless $str =~ /\w+/; # fail unless a real test # $str = '.*' if 1; # sanity test diff --git a/ext/B/t/concise.t b/ext/B/t/concise.t index 075e1da149..faff8a36de 100644 --- a/ext/B/t/concise.t +++ b/ext/B/t/concise.t @@ -92,7 +92,7 @@ SKIP: { my @stylespec; $@=''; eval { add_style ('junk_B' => @stylespec) }; -like ($@, 'expecting 3 style-format args', +like ($@, qr/expecting 3 style-format args/, "add_style rejects insufficient args"); @stylespec = (0,0,0); # right length, invalid values diff --git a/ext/B/t/optree_check.t b/ext/B/t/optree_check.t index 8d3c062b54..1c55fb601c 100644 --- a/ext/B/t/optree_check.t +++ b/ext/B/t/optree_check.t @@ -84,7 +84,7 @@ if (1) { expect => '', expect_nt => ''); }; - like($@, /no '\w+' golden-sample found/, "empty expectations prevented"); + like($@, qr/no '\w+' golden-sample found/, "empty expectations prevented"); $@=''; eval { @@ -95,7 +95,7 @@ if (1) { expect_nt => "\n", expect => "\n"); }; - like($@, /no '\w+' golden-sample found/, + like($@, qr/whitespace only reftext found for '\w+'/, "just whitespace expectations prevented"); } |