- diag
- note
note( message ) or diag( message );
- diag prints out a message along with the rest of the output.
- note() does the same, but when running under the prove it does not show up.
Use it for whatever extra output in order to ensure that your printouts will not interfere with future changes in the test environment modules (such as prove or Test::Harness).
examples/test-more/t/messages.t
use strict; use warnings; use Test::More tests => 1; ok 1; diag "This is a diag message"; note "This is a note message";
$ perl t/messages.t
1..1 ok 1 # This is a diag message # This is a note message
prove t/messages.t
# This is a diag message t/messages.t .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.03 cusr 0.00 csys = 0.05 CPU) Result: PASS
prove -v t/messages.t
# This is a diag message t/messages.t .. 1..1 ok 1 # This is a note message ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.03 cusr 0.00 csys = 0.04 CPU) Result: PASS