diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-10-18 20:31:00 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-10-18 20:31:00 +0200 |
commit | 923cc1bb816922fc7e3d923ecac3b09efc7690cc (patch) | |
tree | 000a67a6fe25b12170472d44fb07b1e81ac1e981 /ext/Fcntl/t | |
parent | 87eca6eccde7fa88e66a2fc2ad817978f8d1c549 (diff) | |
download | perl-923cc1bb816922fc7e3d923ecac3b09efc7690cc.tar.gz |
Convert Fcntl::S_IFMT to XS.
This removes the requirement to call XSLoader::load() at BEGIN time, which
simplifies the Perl code further.
Diffstat (limited to 'ext/Fcntl/t')
-rw-r--r-- | ext/Fcntl/t/mode.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/Fcntl/t/mode.t b/ext/Fcntl/t/mode.t index c7fa8d1c65..4bec2023ad 100644 --- a/ext/Fcntl/t/mode.t +++ b/ext/Fcntl/t/mode.t @@ -18,7 +18,7 @@ if (-c $devnull) { push @tests, ['CHR', $devnull, (stat $devnull)[2]]; } -plan(tests => 6 + 9 * @tests); +plan(tests => 34 + 6 + 9 * @tests); foreach (@tests) { my ($type, $name, $mode) = @$_; @@ -84,3 +84,9 @@ foreach ([S_ISREG => \&S_ISREG], is(scalar @warnings, 1, '1 warning'); like($warnings[0], qr/^Use of uninitialized value/, 'expected warning'); } + +is (S_IFMT(), _S_IFMT(), 'S_IFMT()'); +is (S_IFMT(0), 0, 'S_IFMT(0)'); +for my $shift (0..31) { + is (S_IFMT(1 << $shift), ((1 << $shift) & _S_IFMT()), "S_IFMT(1 << $shift)"); +} |