Skip Menu |
 

This queue is for tickets about the Test-Builder-Tester CPAN distribution.

Report information
The Basics
Id: 14931
Status: new
Priority: 0/
Queue: Test-Builder-Tester

People
Owner: Nobody in particular
Requestors: dakkar [...] thenautilus.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.01
Fixed in: (no value)



Subject: test_fails gives errors when using Test::Builder 0.31
Download (untitled) / with headers
text/plain 447b
Test-Builder-Tester 1.01, Test-Simple 0.61, MacOSX 10.4, stock perl (5.8.6) Test::Builder, in the 'ok' sub, lines 453-454, uses this format for diagnosing failures: $msg test '$name' in $file at line $line. but Test::Builder::Tester expects (test_fail sub, line 242): Failed test ($file at line $line) To fix this, either we pass the test name to test_fail (breaks the API), or resurrect bug #380 and change 'expect' to accept a regexp.
Download (untitled) / with headers
text/plain 633b
[DAKKAR - Wed Oct 5 05:48:37 2005]: Show quoted text
> but Test::Builder::Tester expects (test_fail sub, line 242): > > Failed test ($file at line $line) > > To fix this, either we pass the test name to test_fail (breaks the > API), or resurrect bug #380 and change 'expect' to accept a regexp.
I would suggest using a regex. Its the simplest fix with the least pain and the whole idea of screen scraping Test::More's output is DOOMED in the long run anyway. I'll consider putting in some more information into the Test::Builder->details so information like the file and line number where the test occured can be gotten without scraping.
Download (untitled) / with headers
text/plain 447b
[MSCHWERN - Wed Oct 5 13:11:24 2005]: Show quoted text
> I would suggest using a regex.
Here's the regex I suggest. This covers both the original format and the new one and has a decent chance of handling future minor changes. $err->expect_like(qr/^#\s+Failed test\b/m); $err->expect_like(qr/^#.* \Q$filename\E at line $line\b/); That fixes another buglet, use the caller's $filename, not $0. This is in case a test is run outside of the original test file.
Download (untitled) / with headers
text/plain 135b
[MSCHWERN - Wed Oct 5 14:14:43 2005]: Show quoted text
> $err->expect_like(qr/^#.* \Q$filename\E at line $line\b/);
That should have a /m on the end.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.