question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FullyQualifiedName is not escaped correctly

See original GitHub issue

F# 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Tarmilcommented, Nov 6, 2018

This fix has been reverted by 4ba12de5756414725b1b6369671421e378eb74d1, it’s failing again.

0reactions
stefanforsbergcommented, Jun 12, 2018

Fixed with #90

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found