Skip to content

Commit c34eb5e

Browse files
Blake EasleyBlake Easley
Blake Easley
authored and
Blake Easley
committed
Fix tests
The anazlyer is now detecting variables within arithmetic expressions, but still not let, postfix, or binary expressions So a rename on ``` for i in 1 2 3; do echo "$i" done let i=0 for (( ; i < 10; i++)); do echo "$((2 * i))" done ``` Would be changed to ``` for new_name in 1 2 3; do echo "$new_name" done let i=0 for (( ; i < 10; i++)); do echo "$((2 * new_name))" done ```
1 parent 4025983 commit c34eb5e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/__tests__/server.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,6 @@ describe('server', () => {
14311431
['variable in let expression', 110, 4],
14321432
['variable in binary expression', 111, 9],
14331433
['variable in postfix expression', 111, 17],
1434-
['variable in arithmetic expansion', 112, 14],
14351434
])('returns null for non-renamable symbol: %s', async (_, line, character) => {
14361435
expect(await getPrepareRenameResult(line, character)).toBeNull()
14371436
})
@@ -1741,9 +1740,9 @@ describe('server', () => {
17411740
describe('Edge or not covered cases', () => {
17421741
it('only includes variables typed as variable_name', async () => {
17431742
const iRanges = await getFirstChangeRanges(getRenameRequestResult(106, 4))
1744-
// This should be 6 if all instances within let and arithmetic
1743+
// This should be 6 if all instances within let, postfix, and binary
17451744
// expressions are included.
1746-
expect(iRanges.length).toBe(2)
1745+
expect(iRanges.length).toBe(3)
17471746

17481747
const lineRanges = await getFirstChangeRanges(getRenameRequestResult(118, 10))
17491748
// This should be 2 if the declaration of `line` is included.

0 commit comments

Comments
 (0)