Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for GLOB mmap

  • Loading branch information...
commit 4c8b82e2d99b9a0797678d15334d2a31f7b1ec04 1 parent 6091938
@toddr authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 t/mmap.t
View
13 t/mmap.t
@@ -3,7 +3,7 @@
BEGIN {
use strict;
use warnings;
- use Test::More tests => 6;
+ use Test::More tests => 8;
use_ok('Sys::Mmap');
}
@@ -40,4 +40,15 @@ sysopen(FOO, $temp_file, O_RDONLY) or die "$temp_file: $!\n";
my $bar = <FOO>;
is($bar, 'ABCZ1234', 'Altered foo reflects on disk');
+{
+ my $foo;
+ open(my $fh, "<", $temp_file) or die;
+ isa_ok($fh, 'GLOB');
+ mmap($foo, 0, PROT_READ, MAP_SHARED, $fh);
+ close $fh;
+ is($foo, 'ABCZ1234', 'Read $foo, when it comes from a FileHandle');
+ munmap($foo);
+}
+
+
unlink($temp_file);
Please sign in to comment.
Something went wrong with that request. Please try again.