Skip to content

Commit 6443dd8

Browse files
committed
skip tests that are hopeless
1 parent 92c1c6b commit 6443dd8

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

test/common/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,15 @@ const common = {
10631063
get checkoutEOL() {
10641064
return fs.readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n';
10651065
},
1066+
1067+
get isInsideCWDWithUnusualChars() {
1068+
const cwd = process.cwd();
1069+
return cwd.includes('%') ||
1070+
(!isWindows && cwd.includes('\\')) ||
1071+
cwd.includes('\n') ||
1072+
cwd.includes('\r') ||
1073+
cwd.includes('\t');
1074+
},
10661075
};
10671076

10681077
const validProperties = new Set(Object.keys(common));

test/parallel/test-fs-cp.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mustCall, mustNotMutateObjectDeep } from '../common/index.mjs';
1+
import { mustCall, mustNotMutateObjectDeep, isInsideCWDWithUnusualChars } from '../common/index.mjs';
22

33
import assert from 'assert';
44
import fs from 'fs';
@@ -306,7 +306,7 @@ function nextdir() {
306306
}
307307

308308
// It throws an error if attempt is made to copy socket.
309-
if (!isWindows) {
309+
if (!isWindows && !isInsideCWDWithUnusualChars) {
310310
const src = nextdir();
311311
mkdirSync(src);
312312
const dest = nextdir();

test/parallel/test-npm-install.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
const common = require('../common');
33
if (!common.hasCrypto)
44
common.skip('missing crypto');
5+
if (common.isInsideCWDWithUnusualChars)
6+
common.skip('npm does not support this install path');
57

68
const path = require('path');
79
const exec = require('child_process').exec;

test/parallel/test-startup-empty-regexp-statics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const allRegExpStatics =
6666
assert.strictEqual(child.signal, null);
6767
}
6868

69-
{
69+
if (!common.isInsideCWDWithUnusualChars) {
7070
const child = spawn(process.execPath, [], { stdio: ['pipe', 'pipe', 'inherit'], encoding: 'utf8' });
7171

7272
let stdout = '';

0 commit comments

Comments
 (0)