Skip to content

Commit fe29524

Browse files
committed
Add symbol type equivalencies test
1 parent 2f93517 commit fe29524

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/PowerShellEditorServices.Test/Language/SymbolsServiceTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,20 @@ public async Task FindsReferencesOnMethod()
607607
Assert.Equal(symbols, GetOccurrences(FindsOccurrencesOnTypeSymbolsData.MethodSourceDetails));
608608
}
609609

610+
[Theory]
611+
[InlineData(SymbolType.Class, SymbolType.Type)]
612+
[InlineData(SymbolType.Enum, SymbolType.Type)]
613+
[InlineData(SymbolType.EnumMember, SymbolType.Property)]
614+
[InlineData(SymbolType.Variable, SymbolType.Parameter)]
615+
internal void SymbolTypeEquivalencies(SymbolType left, SymbolType right)
616+
{
617+
// When checking if a symbol's type is the "same" we use this utility method which
618+
// semantically equates the above theory, since for the purposes of narrowing down
619+
// matching symbols, these types are equivalent.
620+
Assert.NotEqual(left, right);
621+
Assert.True(SymbolTypeUtils.SymbolTypeMatches(left, right));
622+
}
623+
610624
[Fact]
611625
public async Task FindsPropertyDefinition()
612626
{

0 commit comments

Comments
 (0)