Skip to content

Commit

Permalink
normalize the check string EOL in checkOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoroz committed Aug 10, 2024
1 parent a6f88be commit 475e870
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/common/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ function logAfterTime(time) {

function checkOutput(str, check) {
if (common.isWindows && typeof str === 'string') {
// Normalize the line endings for the output and the check strings.
str = str.replaceAll(os.EOL, '\n');
if (typeof check === 'string') {
check = check.replaceAll(os.EOL, '\n');
}
}
if ((check instanceof RegExp && !check.test(str)) ||
(typeof check === 'string' && check !== str)) {
Expand Down

0 comments on commit 475e870

Please sign in to comment.