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:
Craig A. Berry 2025-09-01 19:59:42 -05:00
parent 91dde38666
commit f9d2deec76

View File

@ -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 {