deleted
[urisagit/Perl-Docs.git] / t / perms.t
CommitLineData
2b56fd3b 1#!/usr/local/bin/perl -w
2
3use strict ;
4use Test::More ;
5use File::Slurp ;
6
7plan tests => 2 ;
8
9my $file = "perms.$$" ;
10
11my $text = <<END ;
12This is a bit of contents
13to store in a file.
14END
15
16umask 027 ;
17
18write_file( $file, $text ) ;
19is( getmode( $file ), 0640, 'default perms works' ) ;
20unlink $file ;
21
22write_file( $file, { perms => 0777 }, $text ) ;
23is( getmode( $file ), 0750, 'set perms works' ) ;
24unlink $file ;
25
26exit ;
27
28sub getmode {
29 return 07777 & (stat $_[0])[2] ;
30}