From a0de3315e7354811a5ea7be5f4cff9f7590027f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Mon, 22 Apr 2024 23:07:55 +0200 Subject: [PATCH] Add tests for drag-backwards past ignore --- .../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 ccfbfeb04..7af754b69 100644 --- a/src/extension-test/unit/cursor-doc/paredit-test.ts +++ b/src/extension-test/unit/cursor-doc/paredit-test.ts @@ -1464,6 +1464,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', () => {