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