GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: loosen test for negative timestamps in `test-fs-stat-date` · nodejs/node@fe91beb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-fs-stat-date.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-fs-stat-date.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-stat-date.mjs
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ function closeEnough(actual, expected, margin) {
3131
if (process.arch === 'ppc64') {
3232
margin += 1000;
3333
}
34+
35+
// Filesystems without support for timestamps before 1970-01-01, such as NFSv3,
36+
// should return 0 for negative numbers. Do not treat it as error.
37+
if (actual === 0 && expected < 0) {
38+
console.log(`ignored 0 while expecting ${expected}`);
39+
return;
40+
}
41+
3442
assert.ok(Math.abs(Number(actual - expected)) < margin,
3543
`expected ${expected} ± ${margin}, got ${actual}`);
3644
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.