mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 14:26:58 -04:00
add 2 more tests
This commit is contained in:
@@ -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
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user