Skip to content

Commit

Permalink
Add tests for drag-backwards past ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Apr 22, 2024
1 parent 2cdd557 commit a0de331
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/extension-test/unit/cursor-doc/paredit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit a0de331

Please sign in to comment.