Skip to content

Commit 053189e

Browse files
committed
Revert "Remove newly added test for open with :ra mode"
This reverts commit 418466f. cmp. https://irclog.perlgeek.de/perl6-dev/2017-04-13#i_14424307
1 parent 418466f commit 053189e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

S32-io/open.t

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,27 @@ LEAVE unlink PATH;
251251
$fh.close;
252252
}
253253

254+
# test :ra mode
255+
#?rakudo.jvm skip '[io grant] IllegalArgumentException: READ + APPEND not allowed'
256+
{ unlink PATH;
257+
my $fh;
258+
259+
$fh = open PATH, :ra;
260+
ok defined($fh), 'can open non-existent file in :ra mode';
261+
$fh.print('onions are tasty');
262+
$fh.close;
263+
264+
$fh = open PATH, :ra;
265+
ok defined($fh), 'can open existing file in :ra mode';
266+
$fh.print('cats say meow');
267+
268+
$fh.seek(0, SeekFromBeginning);
269+
is $fh.lines.join, 'onions are tastycats say meow',
270+
'can read in :append mode and it appends to existing data';
271+
272+
$fh.close;
273+
}
274+
254275
# test :create mode
255276
#?rakudo.jvm skip "[io grant] NoSuchFileException: t-32-io-open.tmp'"
256277
{ unlink PATH;

0 commit comments

Comments
 (0)