wasm: Properly separate lines in test output

Change-Id: I4b0365038d44ebab91e2b00df8c0b4dc7962bf14
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Piotr Wiercinski 2025-07-17 11:04:25 +02:00
parent 840ed2291e
commit 019aefcd57
1 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@ export class EmrunCommunication {
// method increments the output index by 1. // method increments the output index by 1.
postOutput(output) postOutput(output)
{ {
output += "\n";
if (this.#nextOutputBatch) { if (this.#nextOutputBatch) {
this.#nextOutputBatch += output; this.#nextOutputBatch += output;
} else { } else {
@ -45,9 +46,9 @@ export class EmrunCommunication {
{ {
window.setTimeout(() => window.setTimeout(() =>
{ {
const toSend = this.#nextOutputBatch; const toSend = this.#nextOutputBatch.replace(/\n$/, '');
this.#nextOutputBatch = null; this.#nextOutputBatch = null;
this.#post(`^out^${this.#indexOfMessage++}^${toSend}$`) this.#post(`^out^${this.#indexOfMessage++}^${toSend}`)
.finally(resolve); .finally(resolve);
}, EmrunCommunication.#BATCHING_DELAY); }, EmrunCommunication.#BATCHING_DELAY);
}); });