mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 16:39:36 +00:00
Tie-File/t/09_gen_rs.t: close before reopening
Opening for write a file you've already got open for write is generally a bad idea and on VMS is a hard error, causing this test to fail. So clean up in between tests.
This commit is contained in:
parent
91dde38666
commit
f9d2deec76
5
dist/Tie-File/t/09_gen_rs.t
vendored
5
dist/Tie-File/t/09_gen_rs.t
vendored
@ -111,6 +111,7 @@ if (setup_badly_terminated_file(3)) {
|
||||
$N++;
|
||||
push @a, "next";
|
||||
check_contents($badrec, "next");
|
||||
undef $o; untie @a;
|
||||
}
|
||||
# (51-52)
|
||||
if (setup_badly_terminated_file(2)) {
|
||||
@ -119,6 +120,7 @@ if (setup_badly_terminated_file(2)) {
|
||||
or die "Couldn't tie file: $!";
|
||||
splice @a, 1, 0, "x", "y";
|
||||
check_contents($badrec, "x", "y");
|
||||
undef $o; untie @a;
|
||||
}
|
||||
# (53-56)
|
||||
if (setup_badly_terminated_file(4)) {
|
||||
@ -133,6 +135,7 @@ if (setup_badly_terminated_file(4)) {
|
||||
: "not ok $N \# expected <$badrec>, got <$r[0]>\n";
|
||||
$N++;
|
||||
check_contents("x", "y");
|
||||
undef $o; untie @a;
|
||||
}
|
||||
|
||||
# (57-58) 20020402 The modification would have failed if $\ were set wrong.
|
||||
@ -145,6 +148,7 @@ if (setup_badly_terminated_file(2)) {
|
||||
my $z = $a[0];
|
||||
}
|
||||
check_contents($badrec);
|
||||
undef $o; untie @a;
|
||||
}
|
||||
|
||||
# (59) 20030527 Tom Christiansen pointed out that FETCH returns the wrong
|
||||
@ -162,6 +166,7 @@ if (setup_badly_terminated_file(1)) {
|
||||
print $z eq "hello" ? "ok $N\n" :
|
||||
"not ok $N \# got $z, expected hello\n";
|
||||
$N++;
|
||||
untie @a;
|
||||
}
|
||||
|
||||
sub setup_badly_terminated_file {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user