Skip to content

Commit

Permalink
Fix Windows test errors in src/ls.js and test/cp.js. (#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmashint authored Jun 23, 2024
1 parent d81c325 commit edac78e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ var fs = require('fs');
var common = require('./common');
var glob = require('glob');

var globPatternRecursive = path.sep + '**';
// glob patterns use the UNIX path seperator
var globPatternRecursive = '/**';

common.register('ls', _ls, {
cmdOptions: {
Expand Down
5 changes: 4 additions & 1 deletion test/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,10 @@ test('cp -p should preserve mode, ownership, and timestamp (directory)', t => {

// Both new file and new dir should keep same attributes
t.is(statOfResultDir.mtime.getTime(), newModifyTimeMs);
t.is(statOfResultDir.atime.getTime(), newAccessTimeMs);
utils.skipOnWin(t, () => {
// The resultDir atime may be updated on Windows as a side-effect, e.g. chmod().
t.is(statOfResultDir.atime.getTime(), newAccessTimeMs);
});
t.is(statOfResult.mtime.getTime(), newModifyTimeMs);
t.is(statOfResult.atime.getTime(), newAccessTimeMs);
t.is(statOfResult.mode.toString(8), '100' + mode);
Expand Down

0 comments on commit edac78e

Please sign in to comment.