From 3f0a4987574fbdf6d1dc7ab3c2e62c5ba646f7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Mon, 24 Apr 2023 08:31:41 +0200 Subject: [PATCH] Add tests for identified cases --- .../unit/cursor-doc/paredit-test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/extension-test/unit/cursor-doc/paredit-test.ts b/src/extension-test/unit/cursor-doc/paredit-test.ts index 6a05fdcad..880e24d6e 100644 --- a/src/extension-test/unit/cursor-doc/paredit-test.ts +++ b/src/extension-test/unit/cursor-doc/paredit-test.ts @@ -872,6 +872,33 @@ describe('paredit', () => { await paredit.dragSexprBackward(a, ['b']); expect(textAndSelection(a)).toEqual(textAndSelection(b)); }); + + describe('Ignore markers', () => { + it('Drags past symbol', async () => { + const a = docFromTextNotation('#_a (:b c)|'); + const b = docFromTextNotation('#_(:b c)| a'); + await paredit.dragSexprBackward(a); + expect(textAndSelection(a)).toEqual(textAndSelection(b)); + }); + it('Drags past map', async () => { + const a = docFromTextNotation('#_{:a b} (:c d)|'); + const b = docFromTextNotation('#_(:c d)| {:a b}'); + await paredit.dragSexprBackward(a); + expect(textAndSelection(a)).toEqual(textAndSelection(b)); + }); + it('Drags past ignore after newline', async () => { + const a = docFromTextNotation('(:a b)•#_{:c d}|'); + const b = docFromTextNotation('(:a b)•{:c d}|#_'); + await paredit.dragSexprBackward(a); + expect(textAndSelection(a)).toEqual(textAndSelection(b)); + }); + it('Drags past ignore after space', async () => { + const a = docFromTextNotation('(:a b) #_{:c d}|'); + const b = docFromTextNotation('(:a b) {:c d}|#_'); + await paredit.dragSexprBackward(a); + expect(textAndSelection(a)).toEqual(textAndSelection(b)); + }); + }); }); describe('backwardUp - one line', () => {