Skip to content

Commit 320511c

Browse files
test: the USB mouse test reads the harness's CRLF output on Windows
A MinGW build of the harness writes every line as \r\n, since its stdout is in text mode, and the test split on \n alone: each value it compared carried a \r, all seven cases failed on a Windows checkout, and a real failure among them would have gone unnoticed. CI's Linux runner never saw it. Splitting on \r?\n reads both, as 78bf062 did for the C64 screen scan.
1 parent 357dd2e commit 320511c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Source/Teensy/tests/usb-mouse.test.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ function harness() {
3232
function run(lines) {
3333
const ran = spawnSync(harness(), { input: lines.join('\n') + '\n', encoding: 'utf8' });
3434
assert.equal(ran.status, 0, ran.stderr);
35-
return ran.stdout.split('\n').filter(Boolean);
35+
// A MinGW build of the harness writes its lines as \r\n: stdout is in text mode there.
36+
return ran.stdout.split(/\r?\n/).filter(Boolean);
3637
}
3738

3839
const report = (dx, dy, buttons = 0) => [`report ${dx} ${dy} ${buttons.toString(16)}`, 'poll'];

0 commit comments

Comments
 (0)