From 019aefcd57cb693d74a6cd7b8886a41b10f1a683 Mon Sep 17 00:00:00 2001 From: Piotr Wiercinski Date: Thu, 17 Jul 2025 11:04:25 +0200 Subject: [PATCH] wasm: Properly separate lines in test output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4b0365038d44ebab91e2b00df8c0b4dc7962bf14 Reviewed-by: Edward Welbourne Reviewed-by: Morten Johan Sørvig --- util/wasm/batchedtestrunner/emrunadapter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/wasm/batchedtestrunner/emrunadapter.js b/util/wasm/batchedtestrunner/emrunadapter.js index 5b4284e18ff..73f575f9616 100644 --- a/util/wasm/batchedtestrunner/emrunadapter.js +++ b/util/wasm/batchedtestrunner/emrunadapter.js @@ -37,6 +37,7 @@ export class EmrunCommunication { // method increments the output index by 1. postOutput(output) { + output += "\n"; if (this.#nextOutputBatch) { this.#nextOutputBatch += output; } else { @@ -45,9 +46,9 @@ export class EmrunCommunication { { window.setTimeout(() => { - const toSend = this.#nextOutputBatch; + const toSend = this.#nextOutputBatch.replace(/\n$/, ''); this.#nextOutputBatch = null; - this.#post(`^out^${this.#indexOfMessage++}^${toSend}$`) + this.#post(`^out^${this.#indexOfMessage++}^${toSend}`) .finally(resolve); }, EmrunCommunication.#BATCHING_DELAY); });