Skip to content

Commit e5dc376

Browse files
committed
[io grant] Expand IO::Path.accessed tests
1 parent 0e47f25 commit e5dc376

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

S16-filehandles/filestat.t

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This test tests various file stat methods.
1010
1111
=end pod
1212

13-
plan 10;
13+
plan 11;
1414

1515
# time stat tests (modify/change/access)
1616
{
@@ -37,10 +37,12 @@ plan 10;
3737
my $fh1 = open $tmpfile1, :w orelse die "Could not open $tmpfile1 for writing";
3838
$fh1.print("example content");
3939
$fh1.close;
40+
$ = $tmpfile1.IO.slurp; # read from file to update accessed time
4041

4142
ok ($original1_modified < $tmpfile1.IO.modified), 'IO.modified should be updated when file content changes';
4243
ok ($original1_changed < $tmpfile1.IO.changed), 'IO.changed should be updated when file content changes';
43-
44+
cmp-ok $original1_accessed, '<', $tmpfile1.IO.accessed, 'IO.accessed should be updated when file content changes';
45+
4446
# opening for read
4547
$fh1 = open $tmpfile1, :r orelse die "Could not open $tmpfile1 for reading";
4648
$fh1.close;

0 commit comments

Comments
 (0)