Skip to content

Move CSharp/Test/Emit/Attributes to Emit2#58754

Merged
RikkiGibson merged 1 commit intodotnet:mainfrom
cston:move-tests
Jan 10, 2022
Merged

Move CSharp/Test/Emit/Attributes to Emit2#58754
RikkiGibson merged 1 commit intodotnet:mainfrom
cston:move-tests

Conversation

@cston
Copy link
Copy Markdown
Contributor

@cston cston commented Jan 10, 2022

Avoid exceeding the combined string length maximum for Emit tests.

@cston cston requested a review from a team as a code owner January 10, 2022 20:04
@ghost ghost added the Area-Compilers label Jan 10, 2022
var verifier = CompileAndVerify(source, symbolValidator: validator(true), sourceSymbolValidator: validator(false), expectedOutput: @"System.Int32[]");
}

private static void VerifyParamArrayAttribute(ParameterSymbol parameter, bool expected = true)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original declaration for reference

internal static void VerifyParamArrayAttribute(ParameterSymbol parameter, bool expected = true)
{
Assert.Equal(expected, parameter.IsParams);
var peParameter = (PEParameterSymbol)parameter;
var allAttributes = ((PEModuleSymbol)parameter.ContainingModule).GetCustomAttributesForToken(peParameter.Handle);
var paramArrayAttributes = allAttributes.Where(a => a.AttributeClass.ToTestDisplayString() == "System.ParamArrayAttribute");
if (expected)
{
Assert.Equal(1, paramArrayAttributes.Count());
}
else
{
Assert.Empty(paramArrayAttributes);
}
}
}

@RikkiGibson RikkiGibson added the Test Test failures in roslyn-CI label Jan 10, 2022
Copy link
Copy Markdown
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (iteration 1)

@jcouv jcouv self-assigned this Jan 10, 2022
@RikkiGibson RikkiGibson merged commit 24ef0f3 into dotnet:main Jan 10, 2022
@ghost ghost added this to the Next milestone Jan 10, 2022
@cston cston deleted the move-tests branch January 10, 2022 21:33
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P1 Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Test Test failures in roslyn-CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants