FullyQualifiedName is not escaped correctly
See original GitHub issueF# allows names quoted with double backticks to contain spaces and other special characters. The CLI can handle this, if those names are quoted, otherwise MSBuild interprets the spaces as separate args.
Example:
[<Fact>]
let ``This is a test method`` () = Assert.True(true)
Expected:
dotnet test --filter "FullyQualifiedName~This is a test method"
#...
#Test Run Succesfull.
Actual:
dotnet test --filter FullyQualifiedName~This is a test method
#MSBUILD : error MSB1008: Only one project can be specified.
#Switch: a
#
#For switch syntax, type "MSBuild /help"
The simplest solution would be to just put quotes around the thing and be done with it. However, quotes are legal characters in such names, so they would have to be escaped. This even allows arbitrary code to be executed, if the user selects that test to be run:
[<Fact>]
let ``; echo "Hello World!";`` () = Assert.True(true)
dotnet test --filter FullyQualifiedName~; echo "Hello World!";
# Build started, please wait...
# ...
# No test is available in ...
#
# Hello World!
I think simply quoting the argument is good enough since most test names don’t contain special characters beyond some spaces and escaping strings correctly would be quite some work.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Sending Javascript code to client-side is not escaped correctly
All code has been escaped and encoded with encodeURIComponent so that the system just needs to decode and unescape. But the validation fails....
Read more >Type.GetType Method (System) - Microsoft Learn
Gets the Type with the specified name, performing a case-sensitive search and specifying whether to throw an exception if the type is not...
Read more >Class Laminas\Escaper\Escaper
Fully Qualified Name : Laminas\Escaper\Escaper ... We use an extended set of characters to escape that are not covered by htmlspecialchars() to cover...
Read more >External Data Metadata Format Reference
fieldsEscapedBy, String, No, The character used to escape, or bypass, the creation of a row of data based on detecting the fieldsDelimitedBy value....
Read more >Chapter 7. Packages - Oracle Help Center
A package may not contain two members of the same name, or a compile-time error ... If com.nighthacks.java.jag is the fully qualified name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This fix has been reverted by 4ba12de5756414725b1b6369671421e378eb74d1, it’s failing again.
Fixed with #90