From 1ea61baa94be801c2665f06c834da17578d0783e Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Tue, 9 Jul 2024 19:50:45 +0100 Subject: [PATCH] fix: clipped import of banks Fixes https://github.com/remy/vscode-nextbasic/issues/65 --- __tests__/bas2txt.test.mjs | 7 +++++++ __tests__/fixtures/clipped-lines.bnk | Bin 0 -> 223 bytes bas2txt.mjs | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 __tests__/fixtures/clipped-lines.bnk diff --git a/__tests__/bas2txt.test.mjs b/__tests__/bas2txt.test.mjs index cee6564..ef1d9d3 100644 --- a/__tests__/bas2txt.test.mjs +++ b/__tests__/bas2txt.test.mjs @@ -77,3 +77,10 @@ test('else if (2.08)', (t) => { res = line2txt(src.basic); // to text t.is(res, text, 'new IF correctly rendered'); }); + +test('lines are not being clipped', async (t) => { + const src = await readFile(__dirname + '/fixtures/clipped-lines.bnk'); + const lines = file2txt(src).split('\n').filter(Boolean); + + t.is(lines.length, 4); +}); diff --git a/__tests__/fixtures/clipped-lines.bnk b/__tests__/fixtures/clipped-lines.bnk new file mode 100644 index 0000000000000000000000000000000000000000..1d15e9b5576b3d5ad3d4dba36297fcb9b42dfd5d GIT binary patch literal 223 zcmWIW2@N)O@eh__WVp}3z`z{Oz;GZ6$e