in reply to Unit test of script fails unless Test::Warnings is used?!
Hi, you should use Test::Exception:
#!perl use 5.010; use strict; use lib qw(bin); use Test::More; use Test::Exception; lives_ok sub { require 'script' }; done_testing;
Or better yet, always use Test::Most.
(Your test gets a fail result under prove because you declare done_testing with no tests run so the harness sees no passes. Add ok 1; and you'll get success.)
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unit test of script fails unless Test::Warnings is used?!
by wanna_code_perl (Friar) on Oct 13, 2019 at 01:17 UTC | |
by Your Mother (Archbishop) on Oct 13, 2019 at 01:28 UTC | |
by 1nickt (Canon) on Oct 13, 2019 at 01:35 UTC | |
by 1nickt (Canon) on Oct 13, 2019 at 01:27 UTC |