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: add known issue test for fs.cpSync dereference bug · nodejs/node@f9f3dc9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/known_issues
    • test-fs-cp-sync-dereference.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/known_issues/test-fs-cp-sync-dereference.js‎

Copy file name to clipboard
+39Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
// Refs: https://github.com/nodejs/node/issues/58939
4+
//
5+
// The cpSync function is not correctly handling the `dereference` option.
6+
// In this test, both the cp and cpSync functions are attempting to copy
7+
// a file over a symlinked directory. In the cp case it works fine. In the
8+
// cpSync case it fails with an error.
9+
10+
const common = require('../common');
11+
12+
const {
13+
cp,
14+
cpSync,
15+
mkdirSync,
16+
symlinkSync,
17+
writeFileSync,
18+
} = require('fs');
19+
20+
const {
21+
join,
22+
} = require('path');
23+
24+
const tmpdir = require('../common/tmpdir');
25+
tmpdir.refresh();
26+
27+
const pathA = join(tmpdir.path, 'a');
28+
const pathB = join(tmpdir.path, 'b');
29+
const pathC = join(tmpdir.path, 'c');
30+
const pathD = join(tmpdir.path, 'd');
31+
32+
writeFileSync(pathA, 'file a');
33+
mkdirSync(pathB);
34+
symlinkSync(pathB, pathC, 'dir');
35+
symlinkSync(pathB, pathD, 'dir');
36+
37+
cp(pathA, pathD, { dereference: false }, common.mustSucceed());
38+
39+
cpSync(pathA, pathC, { dereference: false });

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.