-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Move CSharp/Test/Emit/Attributes to Emit2 #58754
Conversation
}; | ||
}; | ||
|
||
var verifier = CompileAndVerify(source, symbolValidator: validator(true), sourceSymbolValidator: validator(false), expectedOutput: @"System.Int32[]"); | ||
} | ||
|
||
private static void VerifyParamArrayAttribute(ParameterSymbol parameter, bool expected = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original declaration for reference
roslyn/src/Compilers/CSharp/Test/Emit/Attributes/WellKnownAttributesTestBase.cs
Lines 86 to 103 in f51c1b2
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); | |
} | |
} | |
} |
There was a problem hiding this 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)
Avoid exceeding the combined string length maximum for Emit tests.