pjf: dual life modules
[p5sagit/p5-mst-13.2.git] / lib / autodie / t / binmode.t
1 #!/usr/bin/perl -w
2 use strict;
3 use Test::More 'no_plan';
4
5 # These are a bunch of general tests for working with files and
6 # filehandles.
7
8 my $r = "default";
9
10 eval {
11     no warnings;
12     $r = binmode(FOO);
13 };
14
15 is($@,"","Sanity: binmode(FOO) doesn't usually throw exceptions");
16 is($r,undef,"Sanity: binmode(FOO) returns undef");
17
18 eval {
19     use autodie qw(binmode);
20     no warnings;
21     binmode(FOO);
22 };
23
24 ok($@, "autodie qw(binmode) should cause failing binmode to die.");
25 isa_ok($@,"autodie::exception", "binmode exceptions are in autodie::exception");
26
27 eval {
28     use autodie;
29     no warnings;
30     binmode(FOO);
31 };
32
33 ok($@, "autodie (default) should cause failing binmode to die.");