Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The code was last touched here #1196 fixing some indeterminate issues with the parsing. Seeing the examples in tests it handles quotes differently and backslashes.
However the code runs out of bounds (not a problem but throws index out of range unnecessarilly).
And fails to recognize
\"that is in quoted string. It detects the\", but the index is not advanced past that", so in the next steps is incorrectly stops being a quoted string and spaces will split the command into more tokens.This is problematic for providing /Tests: which provides the whole test name including spaces etc, in format like this:
The previous logic would split the parameters to be:
And would fail with
Ipsum\")test source not found.New logic correctly splits it to:
I have a much larger file from the issue, but it contains customer data, and the spaces are the only edge case that triggers this problem.
Related issue
https://developercommunity.visualstudio.com/t/vstest-task-fails-with-Unhandled-Except/10527048