Skip to content

Commit 51ff6a5

Browse files
committed
skip tests that are hopeless
1 parent 39402dc commit 51ff6a5

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
@@ -1055,6 +1055,15 @@ const common = {
10551055
get checkoutEOL() {
10561056
return fs.readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n';
10571057
},
1058+
1059+
get isInsideCWDWithUnusualChars() {
1060+
const cwd = process.cwd();
1061+
return cwd.includes('%') ||
1062+
(!isWindows && cwd.includes('\\')) ||
1063+
cwd.includes('\n') ||
1064+
cwd.includes('\r') ||
1065+
cwd.includes('\t');
1066+
},
10581067
};
10591068

10601069
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)