Repository navigation
fix: same filter path and display name for generic tests in both engine modes #7110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e7efb6
020a920
9226c3a
cfd3b78
98c4302
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ | |
| private const string GeneratedNamespace = "TUnit.Generated"; | ||
|
|
||
| private static readonly DiagnosticDescriptor GenerationErrorDescriptor = new( | ||
| "TUNIT0999", | ||
|
Check warning on line 26 in src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs
|
||
| "Source Generation Error", | ||
| "Failed to generate test metadata for {0}.{1}: {2}", | ||
| "TUnit", | ||
|
|
@@ -700,7 +700,7 @@ | |
| string testName; | ||
| if (methodTypeArgs.Length > 0) | ||
| { | ||
| testName = $"{methodName}<{string.Join(", ", methodTypeArgs.Select(t => t.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)))}>"; | ||
| testName = $"{methodName}<{string.Join(", ", methodTypeArgs.Select(t => t.ToTestNameTypeArgument()))}>"; | ||
| } | ||
| else | ||
| { | ||
|
|
@@ -1191,6 +1191,14 @@ | |
|
|
||
| writer.AppendLine($"methodName: \"{EscapeString(entry.TestName)}\","); | ||
| writer.AppendLine($"fullyQualifiedName: \"{EscapeString(fullyQualifiedName)}\","); | ||
|
|
||
| // The test name drops namespaces, so give the test id the fully qualified type arguments | ||
| // to keep instantiations over same-named types from different namespaces distinct. | ||
| if (entry.MethodTypeArgs.Length > 0) | ||
| { | ||
| var identity = $"<{string.Join(", ", entry.MethodTypeArgs.Select(t => t.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)))}>"; | ||
| writer.AppendLine($"methodTypeArgumentsIdentity: \"{EscapeString(identity)}\","); | ||
| } | ||
| WriteSourceLocationArguments(writer, testMethod); | ||
| WriteFilterDataArguments(writer, testMethod); | ||
|
|
||
|
|
@@ -6092,7 +6100,7 @@ | |
| string testName; | ||
| if (methodTypeArgs.Length > 0) | ||
| { | ||
| var methodTypeArgsString = string.Join(", ", methodTypeArgs.Select(t => t.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat))); | ||
| var methodTypeArgsString = string.Join(", ", methodTypeArgs.Select(t => t.ToTestNameTypeArgument())); | ||
| testName = $"{methodName}<{methodTypeArgsString}>"; | ||
| } | ||
| else | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.