add 2 more tests

This commit is contained in:
Felix Roos 2023-07-01 23:55:41 +02:00
parent c7e882e001
commit d686b65dbe

View File

@ -207,10 +207,20 @@ describe('getLeafLocation', () => {
describe('getLeafLocations', () => {
it('gets locations of leaf nodes', () => {
const code = '"bd sd"';
expect(getLeafLocations(code)).toEqual([
expect(getLeafLocations('"bd sd"')).toEqual([
[1, 3], // bd columns
[4, 6], // sd columns
]);
expect(getLeafLocations('"bd*2 [sd cp]"')).toEqual([
[1, 3], // bd columns
[7, 9], // sd columns
[10, 12], // cp columns
[4, 5], // "2" columns
]);
expect(getLeafLocations('"bd*<2 3>"')).toEqual([
[1, 3], // bd columns
[5, 6], // "2" columns
[7, 8], // "3" columns
]);
});
});