Skip to content

Commit

Permalink
escape backslashes for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielschulhof committed Jun 10, 2023
1 parent 983ebd2 commit 1de5ef4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const { spawn } = require('child_process');
const { EOL } = require('os');
const readline = require('readline');

const escapeBackslashes = (pathString) => pathString.split('\\').join('\\\\');

const noop = () => {};

const mustCallChecks = [];
Expand Down Expand Up @@ -203,9 +205,9 @@ exports.runTestWithBuildType = async function (test, buildType) {
exports.runTestInChildProcess = function ({ suite, testName, expectedStderr }) {
return exports.runTestWithBindingPath((bindingName) => {
return new Promise((resolve) => {
bindingName = bindingName.split('\\').join('\\\\');
bindingName = escapeBackslashes(bindingName);
// Test suites are assumed to be located here.
const suitePath = path.join(__dirname, '..', 'child_processes', suite);
const suitePath = escapeBackslashes(path.join(__dirname, '..', 'child_processes', suite));
const child = spawn(process.execPath, [
'--expose-gc',
'-e',
Expand Down

0 comments on commit 1de5ef4

Please sign in to comment.