File: diagnostics.t

package info (click to toggle)
libtest-effects-perl 0.001005-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 224 kB
  • ctags: 28
  • sloc: perl: 493; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use Test::Effects;

plan tests => 2;

effects_ok {
    effects_ok { die "Shouldn't happen" }
               'Not a spec'
                => 'Bad spec';
}
ONLY {
    die => qr/\A\QSecond argument to effects_ok() must be hash or hash reference, not scalar value at\E/,
}
=> 'Bad effects_ok() specification diagnostic';

effects_ok {
    effects_ok { die "Shouldn't happen" }
               { timing => 'all' }
                => 'Bad spec';
}
ONLY {
    die => qr/\A\QInvalid timing specification: timing => 'all'\E/,
}
=> 'Bad timing specification diagnostic';

done_testing();