error tests expansion
.NET Test / .NET tests (push) Failing after 2m5s

This commit is contained in:
2026-07-12 18:06:53 +04:00
parent 2dbfd781ec
commit e8ae93799e
23 changed files with 1190 additions and 156 deletions
+6 -6
View File
@@ -34,13 +34,13 @@ internal sealed class ResultMapExecutor : ResultExtensionsExecutor
}
""");
GenerateAsyncMethods("Task", sb, templateArgNames, resultTypeDef, resultValueExpansion);
GenerateAsyncMethods("ValueTask", sb, templateArgNames, resultTypeDef, resultValueExpansion);
GenerateAsyncMethods("Task", string.Empty, sb, templateArgNames, resultTypeDef, resultValueExpansion);
GenerateAsyncMethods("ValueTask", "ValueTask", sb, templateArgNames, resultTypeDef, resultValueExpansion);
sb.AppendLine("#endregion");
}
private static void GenerateAsyncMethods(string taskType, StringBuilder sb, ImmutableArray<string> templateArgNames, string resultTypeDef, string resultValueExpansion)
private static void GenerateAsyncMethods(string taskType, string methodSuffix, StringBuilder sb, ImmutableArray<string> templateArgNames, string resultTypeDef, string resultValueExpansion)
{
var methodTemplateArgNames = templateArgNames.Add("R");
string methodTemplateDecl = GenerateTemplateDecl(methodTemplateArgNames);
@@ -49,7 +49,7 @@ internal sealed class ResultMapExecutor : ResultExtensionsExecutor
sb.AppendLine($$"""
[PureAttribute]
[GeneratedCodeAttribute("{{nameof(ResultMapExecutor)}}", "1.0.0.0")]
public static async {{taskType}}<Result<R>> Map{{methodTemplateDecl}}(this {{taskType}}<{{resultTypeDef}}> resultTask, Func{{methodTemplateDecl}} mapping)
public static async {{taskType}}<Result<R>> Map{{methodSuffix}}{{methodTemplateDecl}}(this {{taskType}}<{{resultTypeDef}}> resultTask, Func{{methodTemplateDecl}} mapping)
{
var result = await resultTask.ConfigureAwait(false);
return result.State switch
@@ -64,7 +64,7 @@ internal sealed class ResultMapExecutor : ResultExtensionsExecutor
sb.AppendLine($$"""
[PureAttribute]
[GeneratedCodeAttribute("{{nameof(ResultMapExecutor)}}", "1.0.0.0")]
public static async {{taskType}}<Result<R>> Map{{methodTemplateDecl}}(this {{resultTypeDef}} result, Func{{asyncActionTemplateDecl}} mapping)
public static async {{taskType}}<Result<R>> Map{{methodSuffix}}{{methodTemplateDecl}}(this {{resultTypeDef}} result, Func{{asyncActionTemplateDecl}} mapping)
{
return result.State switch
{
@@ -78,7 +78,7 @@ internal sealed class ResultMapExecutor : ResultExtensionsExecutor
sb.AppendLine($$"""
[PureAttribute]
[GeneratedCodeAttribute("{{nameof(ResultMapExecutor)}}", "1.0.0.0")]
public static async {{taskType}}<Result<R>> Map{{methodTemplateDecl}}(this {{taskType}}<{{resultTypeDef}}> resultTask, Func{{asyncActionTemplateDecl}} mapping)
public static async {{taskType}}<Result<R>> Map{{methodSuffix}}{{methodTemplateDecl}}(this {{taskType}}<{{resultTypeDef}}> resultTask, Func{{asyncActionTemplateDecl}} mapping)
{
var result = await resultTask.ConfigureAwait(false);
return result.State switch