File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,27 @@ LEAVE unlink PATH;
251
251
$ fh . close ;
252
252
}
253
253
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
+
254
275
# test :create mode
255
276
# ?rakudo.jvm skip "[io grant] NoSuchFileException: t-32-io-open.tmp'"
256
277
{ unlink PATH;
You can’t perform that action at this time.
0 commit comments