From 1aaca8dd8b9554b78989f2f13d26cb893db7bdac 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 e1e36e4eb..d0368c961 100644 --- a/src/extension-test/unit/cursor-doc/paredit-test.ts +++ b/src/extension-test/unit/cursor-doc/paredit-test.ts @@ -896,6 +896,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', () => {