Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
tisonkun committed Aug 9, 2018
1 parent 0003b32 commit 261276c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions t/nqp/019-file-ops.t
Expand Up @@ -332,29 +332,28 @@ nqp::unlink($test-file) if nqp::stat($test-file, nqp::const::STAT_EXISTS); # cle

if $is-windows || ($backend ne 'moar' && $backend ne 'js' && $backend ne 'jvm') {
skip("symlink test not tested on Windows or $backend", 9);
}
else {

} else {
my $symlink := $test-file ~ '-symlink';
my $file := 't/nqp/019-file-ops.t';

nqp::symlink('t/nqp/019-file-ops.t', $symlink);


for [nqp::const::STAT_MODIFYTIME, nqp::const::STAT_ACCESSTIME, nqp::const::STAT_CHANGETIME] -> $flag {
ok(nqp::stat_time($file, $flag) == nqp::lstat_time($file, $flag), 'stat_time works as lstat_time on regular file');
ok(nqp::stat($file, $flag) == nqp::lstat($file, $flag), 'stat works as lstat on regular file');
ok(nqp::stat_time($symlink, $flag) == nqp::lstat_time($file, $flag), 'stat_time follows symlink');
if ($flag != nqp::const::STAT_CHANGETIME) {
if ($flag == nqp::const::STAT_CHANGETIME) {
skip("lstat_time doesn\'t follow symlink' doen't work with flag $flag yet.", 1)
} elsif ($flag == nqp::const::STAT_ACCESSTIME && $backend eq 'jvm') {
skip("lstat_time doesn\'t follow symlink' doen't work with flag $flag on jvm yet.", 1)
} else {
ok(nqp::lstat_time($symlink, $flag) != nqp::lstat_time($file, $flag), 'lstat_time doesn\'t follow symlink');
}
}


if nqp::lstat($symlink, nqp::const::STAT_EXISTS) {
nqp::unlink($symlink);
}

}

{
Expand Down

5 comments on commit 261276c

@zoffixznet
Copy link
Contributor

@zoffixznet zoffixznet commented on 261276c Aug 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That commit message doesn't explain anything about the commit. I can see without the message that the test was updated. A good message explains why.

For the record, this file now fails for me:

$ prove -e ./nqp t/nqp/019-file-ops.t
t/nqp/019-file-ops.t .. All 111 subtests passed 
	(less 1 skipped subtest: 110 okay)

Test Summary Report
-------------------
t/nqp/019-file-ops.t (Wstat: 0 Tests: 112 Failed: 1)
  Failed test:  112
  Parse errors: Bad plan.  You planned 111 tests but ran 112.
Files=1, Tests=112,  1 wallclock secs ( 0.03 usr  0.00 sys +  0.74 cusr  0.04 csys =  0.81 CPU)
Result: FAIL

@zoffixznet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in b9c0bfc to make the test suit pass.

@tisonkun
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is missing for updating plan number.

@tisonkun
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after revert, the test would fail if jvm backend enable again.

@zoffixznet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreverted and fixed the plan c05a312

Please sign in to comment.