Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 14764
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: mark [...] summersault.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Date: Mon, 26 Sep 2005 09:46:17 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: Michael G Schwern <schwern [...] pobox.com>
Subject: Thanks, and a suggestion for "note".
Download (untitled) / with headers
text/plain 952b
Michael, Thanks so much for your work on Test::Simple/More/Builder. I'd like to share another enhancement that has worked well for me. I wanted to have comments that showed up in verbose mode but note in the condensed mode. It just makes sense to able to have more detailed comments along with more detailed test output. I implemented it like this, for my own project: =head2 note() note "My Comment Only for Verbose Mode" Use this function to create a comment that shows up in verbose test output, but not the bulk test runs. =cut sub note($) { my $msg = shift; print "# $msg\n"; } From looking at the source code for "diag", a proper solution might more complicated, but this worked great for me without any noticeable drawbacks. The name difference of "diag" versus "note" could be improved to better reflect their relationship, but "note" is certainly handy for being so short. Mark
Subject: a plug again for note/explain
From: MARKSTOS [...] cpan.org
Download (untitled) / with headers
text/plain 1.3k
Ovid independently developed roughly the same thing, and posted the code for it here: http://use.perl.org/~Ovid/journal/35363 sub explain { return unless $ENV{TEST_VERBOSE}; Test::More::diag(@_); } This seems like a very simple and useful to add. On Mon Sep 26 16:17:27 2005, mark@summersault.com wrote: Show quoted text
> Michael, > > Thanks so much for your work on Test::Simple/More/Builder. > > I'd like to share another enhancement that has worked well for me. > > I wanted to have comments that showed up in verbose mode but note in > the > condensed mode. It just makes sense to able to have more detailed > comments along with more detailed test output. > > I implemented it like this, for my own project: > > =head2 note() > > note "My Comment Only for Verbose Mode" > > Use this function to create a comment that shows up in verbose > test output, but not the bulk test runs. > > =cut > > sub note($) { > my $msg = shift; > print "# $msg\n"; > } > > From looking at the source code for "diag", a proper solution might > more > complicated, but this worked great for me without any noticeable > drawbacks. > > The name difference of "diag" versus "note" could be improved to > better reflect > their relationship, but "note" is certainly handy for being so short. > > Mark >
I've (finally) added note() to Test::More.


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.