Skip to content

Commit

Permalink
Escape quotes in test filter expressions (#1999)
Browse files Browse the repository at this point in the history
* Update structuredlogger to fix FAKE build

* Escape quotes in test filters

Fixes issues running unit tests from the explorer that have quotes in the test name
  • Loading branch information
farlee2121 authored Apr 5, 2024
1 parent b0d2ebe commit ddb6b80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ group build
// Enforce updated binlog parser until Fake gets an update, so we're not stuck
// on an old sdk version.
// ref: https://github.com/fsprojects/FAKE/issues/2744
nuget MSBuild.StructuredLogger >= 2.1.784
nuget MSBuild.StructuredLogger >= 2.2
2 changes: 1 addition & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ NUGET
System.Security.Principal.Windows (>= 5.0)
Microsoft.Win32.SystemEvents (7.0)
Mono.Posix.NETStandard (1.0)
MSBuild.StructuredLogger (2.1.846)
MSBuild.StructuredLogger (2.2.206)
Microsoft.Build.Framework (>= 17.5)
Microsoft.Build.Utilities.Core (>= 17.5)
Newtonsoft.Json (13.0.2)
Expand Down
5 changes: 4 additions & 1 deletion src/Components/TestExplorer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,10 @@ module Interactions =
|> Promise.ofThenable

let private filterEscapeCharacter = '\\'
let private filterSpecialCharacters = [| '\\'; '('; ')'; '&'; '|'; '='; '!'; '~' |]

let private filterSpecialCharacters =
[| '\\'; '('; ')'; '&'; '|'; '='; '!'; '~'; '"' |]

let private filterSpecialCharactersSet = Set.ofArray filterSpecialCharacters

let private buildFilterExpression (tests: TestItem array) =
Expand Down

0 comments on commit ddb6b80

Please sign in to comment.