Skip to content

Commit f9d2dee

Browse files
committed
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.
1 parent 91dde38 commit f9d2dee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dist/Tie-File/t/09_gen_rs.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ if (setup_badly_terminated_file(3)) {
111111
$N++;
112112
push @a, "next";
113113
check_contents($badrec, "next");
114+
undef $o; untie @a;
114115
}
115116
# (51-52)
116117
if (setup_badly_terminated_file(2)) {
@@ -119,6 +120,7 @@ if (setup_badly_terminated_file(2)) {
119120
or die "Couldn't tie file: $!";
120121
splice @a, 1, 0, "x", "y";
121122
check_contents($badrec, "x", "y");
123+
undef $o; untie @a;
122124
}
123125
# (53-56)
124126
if (setup_badly_terminated_file(4)) {
@@ -133,6 +135,7 @@ if (setup_badly_terminated_file(4)) {
133135
: "not ok $N \# expected <$badrec>, got <$r[0]>\n";
134136
$N++;
135137
check_contents("x", "y");
138+
undef $o; untie @a;
136139
}
137140

138141
# (57-58) 20020402 The modification would have failed if $\ were set wrong.
@@ -145,6 +148,7 @@ if (setup_badly_terminated_file(2)) {
145148
my $z = $a[0];
146149
}
147150
check_contents($badrec);
151+
undef $o; untie @a;
148152
}
149153

150154
# (59) 20030527 Tom Christiansen pointed out that FETCH returns the wrong
@@ -162,6 +166,7 @@ if (setup_badly_terminated_file(1)) {
162166
print $z eq "hello" ? "ok $N\n" :
163167
"not ok $N \# got $z, expected hello\n";
164168
$N++;
169+
untie @a;
165170
}
166171

167172
sub setup_badly_terminated_file {

0 commit comments

Comments
 (0)