8 plan(skip_all => "GDBM_File was not built")
9 unless $Config{extensions} =~ /\bGDBM_File\b/;
11 # https://rt.perl.org/Public/Bug/Display.html?id=117967
12 plan(skip_all => "GDBM_File is flaky in $^O")
21 open my $fh, '<', $^X or die "Can't open $^X: $!";
22 my $fileno = fileno $fh;
23 isnt($fileno, undef, "Can find next available file descriptor");
26 is((open $fh, "<&=$fileno"), undef,
27 "Check that we cannot open fileno $fileno. \$! is $!");
31 isa_ok(tie(%h, 'GDBM_File', 'fatal_dbmx', GDBM_WRCREAT, 0640), 'GDBM_File');
33 isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
35 isnt(close $fh, undef,
36 "close fileno $fileno, out from underneath the GDBM_File");
41 }, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
43 # Observed "File write error" and "lseek error" from two different systems.
44 # So there might be more variants. Important part was that we trapped the error
46 like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
47 'expected error message from GDBM_File');