1- import { mustCall , mustNotMutateObjectDeep } from '../common/index.mjs' ;
1+ import { mustCall , mustNotMutateObjectDeep , isInsideDirWithUnusualChars } from '../common/index.mjs' ;
22
33import assert from 'assert' ;
44import fs from 'fs' ;
@@ -264,7 +264,7 @@ function nextdir(dirname) {
264264}
265265
266266// It throws error if parent directory of symlink in dest points to src.
267- {
267+ if ( ! isInsideDirWithUnusualChars ) {
268268 const src = nextdir ( ) ;
269269 mkdirSync ( join ( src , 'a' ) , mustNotMutateObjectDeep ( { recursive : true } ) ) ;
270270 const dest = nextdir ( ) ;
@@ -279,7 +279,7 @@ function nextdir(dirname) {
279279}
280280
281281// It throws error if attempt is made to copy directory to file.
282- {
282+ if ( ! isInsideDirWithUnusualChars ) {
283283 const src = nextdir ( ) ;
284284 mkdirSync ( src , mustNotMutateObjectDeep ( { recursive : true } ) ) ;
285285 const dest = './test/fixtures/copy/kitchen-sink/README.md' ;
@@ -310,7 +310,7 @@ function nextdir(dirname) {
310310
311311
312312// It throws error if attempt is made to copy file to directory.
313- {
313+ if ( ! isInsideDirWithUnusualChars ) {
314314 const src = './test/fixtures/copy/kitchen-sink/README.md' ;
315315 const dest = nextdir ( ) ;
316316 mkdirSync ( dest , mustNotMutateObjectDeep ( { recursive : true } ) ) ;
@@ -346,7 +346,7 @@ function nextdir(dirname) {
346346
347347// It throws error if attempt is made to copy src to dest
348348// when src is parent directory of the parent of dest
349- {
349+ if ( ! isInsideDirWithUnusualChars ) {
350350 const src = nextdir ( 'a' ) ;
351351 const destParent = nextdir ( 'a/b' ) ;
352352 const dest = nextdir ( 'a/b/c' ) ;
@@ -370,7 +370,7 @@ function nextdir(dirname) {
370370}
371371
372372// It throws an error if attempt is made to copy socket.
373- if ( ! isWindows ) {
373+ if ( ! isWindows && ! isInsideDirWithUnusualChars ) {
374374 const src = nextdir ( ) ;
375375 mkdirSync ( src ) ;
376376 const dest = nextdir ( ) ;
@@ -738,7 +738,7 @@ if (!isWindows) {
738738}
739739
740740// It returns an error if attempt is made to copy socket.
741- if ( ! isWindows ) {
741+ if ( ! isWindows && ! isInsideDirWithUnusualChars ) {
742742 const src = nextdir ( ) ;
743743 mkdirSync ( src ) ;
744744 const dest = nextdir ( ) ;
0 commit comments