It appears that simply putting a say
, print
, etc into a .t
doesn't work. The output is hidden. So when using Test::More
and Test::Tester
how can I simply print something? I want this so I can play with some code while determining how to test it. note: it's ok if it's sent to stderr or only viewable using verbose. Also I dried using diag
but that didn't appear to work just anywhere in the test.
相关问题
- $ENV{$variable} in perl
- Is it possible to pass command-line arguments to @
- Redirecting STDOUT and STDERR to a file, except fo
- Change first key of multi-dimensional Hash in perl
- Get access to Angular service instance from JavaSc
相关文章
- Web Test recorder does not allow me to record a te
- Factory_girl has_one relation with validates_prese
- Running a perl script on windows without extension
- Comparing speed of non-matching regexp
- What is the difference between `assert_frame_equal
- Can NOT List directory including space using Perl
- Extracting columns from text file using Perl one-l
- Lazy (ungreedy) matching multiple groups using reg
If you run a test script directly, you will see the output of
print
-- tests are just Perl code. However, if you run your tests using a harness, what you see in the output will be determined by the harness, especially its verbosity level, and by whether you print toSTDOUT
orSTDERR
.For another way to print messages within tests, see Diagnostics in the documentation for
Test::More
, notably:Experimenting with a script like this will quickly illustrate how things work: