File: assert_isnt.t

package info (click to toggle)
libcarp-assert-more-perl 1.10-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 164 kB
  • ctags: 26
  • sloc: perl: 762; makefile: 51
file content (19 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!perl -Tw

use warnings;
use strict;

use Test::More tests => 9;
use Test::Exception;

BEGIN { use_ok( 'Carp::Assert::More' ); }

lives_ok   { assert_isnt( 4, 3 ) }	"4 is not 3";
lives_ok   { assert_isnt( undef, "" ) }	"Undef is not space";
lives_ok   { assert_isnt( "", undef ) }	"Space is not undef";

throws_ok    { assert_isnt( undef, undef ) }	qr/Assertion.+failed/,  "Undef only matches undef";
throws_ok    { assert_isnt( "a", "a" ) }	qr/Assertion.+failed/,  "a is a";
throws_ok    { assert_isnt( 4, 4 )	}	qr/Assertion.+failed/,  "4 is 4";
throws_ok    { assert_isnt( "", "" ) }		qr/Assertion.+failed/,  "space is space";
throws_ok    { assert_isnt( "14", 14 ) }	qr/Assertion.+failed/,  "14 is 14 as strings";