File: lives_and.t

package info (click to toggle)
libtest-exception-perl 0.20-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 144 kB
  • ctags: 194
  • sloc: makefile: 459; perl: 328
file content (17 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /usr/bin/perl

use strict;
use Test::More tests => 4;

BEGIN { use_ok( 'Test::Exception' ) };

sub works {return shift};
sub dies { die 'oops' };

lives_and {is works(42), 42} 'lives_and, no_exception & success';

TODO: {
	local $TODO = 'we expect this test to fail';
	lives_and {is works(42), 24}	'lives_and, no_exception & failure';
	lives_and {is dies(42), 42}		'lives_and, exception';
};