File: assert_undefined.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 (15 lines) | stat: -rw-r--r-- 499 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!perl

use warnings;
use strict;

use Test::More tests => 4;

use Carp::Assert::More;

use Test::Exception;

throws_ok( sub { assert_undefined( 3, 'Fleegle' ); }, qr/\QAssertion (Fleegle) failed!/, '3 is defined' );
throws_ok( sub { assert_undefined( 0, 'Drooper' ); }, qr/\QAssertion (Drooper) failed!/, '0 is defined' );
throws_ok( sub { assert_undefined( '', 'Snork' ); }, qr/\QAssertion (Snork) failed!/, 'blank is defined' );
lives_ok(  sub { assert_undefined( undef ); }, '0 is undefined' );