Skip to content

Commit

Permalink
fix: find reference tests relying on wrong expected behaviour (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
LoZander authored Dec 13, 2024
1 parent 4ead9bd commit 84f709f
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions test/src/findReferences.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2024 Holger Dal Mogensen
* Copyright 2024 Alexander Dybdahl Troelsen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,13 +44,13 @@ suite('Find references', () => {

test('Should find references to Shape.Circle enum case', async () => {
await testFindReferences(mainDocUri, new vscode.Position(3, 9), [
new vscode.Location(mainDocUri, new vscode.Range(3, 9, 3, 22)),
new vscode.Location(mainDocUri, new vscode.Range(3, 9, 3, 15)),
new vscode.Location(areaDocUri, new vscode.Range(5, 13, 5, 25)),
])
})
test('Should find references to Shape.Circle enum case-use', async () => {
await testFindReferences(areaDocUri, new vscode.Position(5, 13), [
new vscode.Location(mainDocUri, new vscode.Range(3, 9, 3, 22)),
new vscode.Location(mainDocUri, new vscode.Range(3, 9, 3, 15)),
new vscode.Location(areaDocUri, new vscode.Range(5, 13, 5, 25)),
])
})
Expand Down Expand Up @@ -80,6 +81,8 @@ suite('Find references', () => {
await testFindReferences(equatableDocUri, new vscode.Position(2, 12), [
new vscode.Location(equatableDocUri, new vscode.Range(2, 12, 2, 18)),
new vscode.Location(equatableDocUri, new vscode.Range(9, 41, 9, 57)),
new vscode.Location(equatableDocUri, new vscode.Range(6, 12, 6, 18)),
new vscode.Location(equatableDocUri, new vscode.Range(15, 12, 15, 18)),
new vscode.Location(equatableDocUri, new vscode.Range(22, 4, 22, 20)),
new vscode.Location(equatableDocUri, new vscode.Range(29, 4, 29, 20)),
new vscode.Location(equatableDocUri, new vscode.Range(36, 8, 36, 24)),
Expand Down Expand Up @@ -174,15 +177,4 @@ suite('Find references', () => {
new vscode.Location(equatableDocUri, new vscode.Range(22, 21, 22, 26)),
])
})

test('Should find references to record label', async () => {
await testFindReferences(recordsDocUri, new vscode.Position(3, 6), [
new vscode.Location(recordsDocUri, new vscode.Range(2, 13, 2, 14)),
new vscode.Location(recordsDocUri, new vscode.Range(2, 48, 2, 49)),
new vscode.Location(recordsDocUri, new vscode.Range(3, 6, 3, 7)),
new vscode.Location(recordsDocUri, new vscode.Range(13, 14, 13, 15)),
new vscode.Location(recordsDocUri, new vscode.Range(15, 8, 15, 9)),
new vscode.Location(recordsDocUri, new vscode.Range(15, 15, 15, 16)),
])
})
})

0 comments on commit 84f709f

Please sign in to comment.