Skip to content

Commit

Permalink
Add skipped hanging beckwardlistoftype test
Browse files Browse the repository at this point in the history
Exposes #1585 pretty spot on
  • Loading branch information
PEZ committed Mar 9, 2022
1 parent 058be6a commit 34cabf6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/extension-test/unit/cursor-doc/token-cursor-test.ts
Expand Up @@ -492,6 +492,25 @@ describe('Token Cursor', () => {
expect(cursor.offsetStart).toBe(b.selectionLeft);
expect(result).toBe(false);
});
it('Moves backward in unbalanced list when outer list is balanced', () => {
// https://github.com/BetterThanTomorrow/calva/issues/1585
const a = docFromTextNotation('(let [a|)');
const b = docFromTextNotation('(let [|a)');
const cursor: LispTokenCursor = a.getTokenCursor(a.selectionLeft);
const result = cursor.backwardListOfType('[');
expect(cursor.offsetStart).toBe(b.selectionLeft);
expect(result).toBe(true);
});
it.skip('Moves backward in balanced list when inner list is unbalanced', () => {
// This never conmpletes in Calva v2.0.252
// https://github.com/BetterThanTomorrow/calva/issues/1585
const a = docFromTextNotation('(let [a|)');
const b = docFromTextNotation('(let [|a)');
const cursor: LispTokenCursor = a.getTokenCursor(a.selectionLeft);
const result = cursor.backwardListOfType('(');
expect(cursor.offsetStart).toBe(b.selectionLeft);
expect(result).toBe(true);
});
it('Does not move when list type is not found', () => {
const a = docFromTextNotation('([|])');
const b = docFromTextNotation('([|])');
Expand Down

0 comments on commit 34cabf6

Please sign in to comment.