~ubuntu-branches/ubuntu/utopic/libfile-chmod-perl/utopic

« back to all changes in this revision

Viewing changes to t/load_chmod.t

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2013-12-27 21:43:17 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131227214317-56ntbqakib5po1nk
Tags: 0.40-1
* New upstream release.
* Install new CONTRIBUTING file.
* Declare compliance with Debian Policy 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# load_chmod.t
 
2
#
 
3
# Since perl v5.14 (or thereabouts), a warning is issued when the autodie
 
4
# pragma is used and &File::chmod::chmod doesn't match the prototype of (@)
 
5
# that CORE::chmod has.  Adding a prototype to &File::chmod::chmod silences
 
6
# the warning.  This test ensures that the prototype doesn't get lost
 
7
# somewhere in the future.
 
8
 
 
9
use strict;
 
10
use warnings;
 
11
use autodie;
 
12
use utf8;
 
13
use Test::More;
 
14
 
 
15
my $test_passed;
 
16
BEGIN {
 
17
    $test_passed = 1;
 
18
    $SIG{__WARN__} = sub {
 
19
        my $msg = shift;
 
20
        if ( $msg =~ m/Prototype\s+mismatch:\s+sub\s+main::chmod/i ) {
 
21
            $test_passed = 0;
 
22
        }
 
23
    };
 
24
}
 
25
 
 
26
use File::chmod;
 
27
ok( $test_passed, "Load File::chmod without 'Missing prototype' warning" );
 
28
 
 
29
done_testing;