File: assert_or.t

package info (click to toggle)
libcarp-assert-more-perl 2.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 376 kB
  • sloc: perl: 2,482; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 404 bytes parent folder | download
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
#!perl

use warnings;
use strict;

use Test::More tests => 5;

use Test::Exception;

use Carp::Assert::More;

my $af = qr/Assertion failed/;


OR: {
    lives_ok( sub { assert_or( 0, 'q' ) } );
    lives_ok( sub { assert_or( 'q', 0 ) } );
    lives_ok( sub { assert_or( 2112, 5150 ) } );

    throws_ok( sub { assert_or( 0, 0 ) }, $af );
    throws_ok( sub { assert_or( '', undef ) }, $af );
}


exit 0;