-
Notifications
You must be signed in to change notification settings - Fork 323
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
ManagedNameUtilities does not support spaces and other special characters in method names #2733
Comments
Yes, I agree we should add this support. |
Some escaped examples are below: IL:
IL:
IL:
IL:
IL:
IL:
IL:
IL:
IL:
|
@peterwald @Haplois Note that we will need to implement identical support on the Roslyn side. I am not sure if Roslyn will create symbols for types / methods with such names - but we should at least ensure that the code fails in a graceful / predictable way. |
The choices above seem reasonable although I have a few questions -
|
@Haplois Could you please share a link to the IL documentation around escaping upon which the proposed escaping format above is based? |
In this case, |
We don't escape a char if
It's the same as C# standard (https://www.ecma-international.org/wp-content/uploads/ECMA-334_5th_edition_december_2017.pdf, page 41, 7.4.3 Identifiers) |
It's easier to parse if we use |
|
I like the idea of matching the encoding of C#. How would we escape |
We're escaping that as |
I made some changes to our escaping. With the new changes, if a string segment is not a valid c# identifier I put it inside single quotes, and only escape
|
Description
We're switching to the
Microsoft.TestPlatform.AdapterUtilities
package to ensure every test method has a unique name. (See https://github.com/microsoft/vstest-docs/blob/master/RFCs/0017-Managed-TestCase-Properties.md) In our current implementation, we won't allow spaces in method names; F# does. Do we need to support it?It looks like CIL supports all kinds of strings in type names. (https://www.ecma-international.org/wp-content/uploads/ECMA-335_5th_edition_december_2010.pdf, page 135, 5.3 Identifiers)
Should we support all cases CIL supports? TestPlatfrom currently supports spaces and dots in the method name; if we omit this support, it'll be a breaking change.
Steps to reproduce
Compile
Call
Expected behavior
It should return the correct MethodBase.
Actual behavior
AB#1274433
The text was updated successfully, but these errors were encountered: