(tree: Tree, aa: TestData[])
| 43 | } |
| 44 | |
| 45 | function expectFindNodeAtOffset(tree: Tree, aa: TestData[]) { |
| 46 | for (const { id, offset, length, boundOffset, boundLength } of aa) { |
| 47 | { |
| 48 | const r = tree.findNodeAtOffset(boundOffset); |
| 49 | const parentId = getParentId(id); |
| 50 | expect(r?.node?.id).toEqual(parentId); |
| 51 | } |
| 52 | { |
| 53 | const r = tree.findNodeAtOffset(boundOffset + boundLength); |
| 54 | expect(r?.node?.id).toEqual(id); |
| 55 | } |
| 56 | { |
| 57 | const r = tree.findNodeAtOffset(offset + 1); |
| 58 | expect(r?.node?.id).toEqual(id); |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | describe("check offset and boundOffset of parseAndFormat", () => { |
| 64 | test("literal value", async () => { |
no test coverage detected