From 89f738da45903bb0ddb0eb8251496f75fc4bfc6d Mon Sep 17 00:00:00 2001 From: larabr <7375870+larabr@users.noreply.github.com> Date: Tue, 22 Dec 2020 14:26:03 +0100 Subject: [PATCH] Fix EOL in streaming tests --- test/general/streaming.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/general/streaming.js b/test/general/streaming.js index 009efd7c..85364590 100644 --- a/test/general/streaming.js +++ b/test/general/streaming.js @@ -400,7 +400,7 @@ function tests() { const message = await openpgp.readArmoredMessage(openpgp.stream.transform(encrypted, value => { value += ''; if (value === '=' || value.length === 6) return; // Remove checksum - const newlineIndex = value.indexOf('\r\n', 500); + const newlineIndex = value.indexOf('\n', 500); if (value.length > 1000) return value.slice(0, newlineIndex - 1) + (value[newlineIndex - 1] === 'a' ? 'b' : 'a') + value.slice(newlineIndex); return value; })); @@ -435,7 +435,7 @@ function tests() { const message = await openpgp.readArmoredMessage(openpgp.stream.transform(encrypted, value => { value += ''; - const newlineIndex = value.indexOf('\r\n', 500); + const newlineIndex = value.indexOf('\n', 500); if (value.length > 1000) return value.slice(0, newlineIndex - 1) + (value[newlineIndex - 1] === 'a' ? 'b' : 'a') + value.slice(newlineIndex); return value; })); @@ -470,7 +470,7 @@ function tests() { const message = await openpgp.readArmoredMessage(openpgp.stream.transform(encrypted, value => { value += ''; - const newlineIndex = value.indexOf('\r\n', 500); + const newlineIndex = value.indexOf('\n', 500); if (value.length > 1000) return value.slice(0, newlineIndex - 1) + (value[newlineIndex - 1] === 'a' ? 'b' : 'a') + value.slice(newlineIndex); return value; })); @@ -501,7 +501,7 @@ function tests() { const message = await openpgp.readArmoredMessage(openpgp.stream.transform(signed, value => { value += ''; - const newlineIndex = value.indexOf('\r\n', 500); + const newlineIndex = value.indexOf('\n', 500); if (value.length > 1000) return value.slice(0, newlineIndex - 1) + (value[newlineIndex - 1] === 'a' ? 'b' : 'a') + value.slice(newlineIndex); return value; }));