Skip to content

Commit 62d8f9b

Browse files
committed
Fix error when test names contain --
We currently store the test's FullyQualifiedName in the id and separate it from other id components with -- This led to incorrectly splitting the test name if it contained a -- It may be a good idea to dynamically add a field to TestItem for FullyQualifiedName similar to what was donen for TestFramework
1 parent 7e104df commit 62d8f9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Components/TestExplorer.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,10 @@ module TestItem =
766766
let constructProjectRootId (projectPath: ProjectPath) : TestId = constructId projectPath ""
767767

768768
let private componentizeId (testId: TestId) : (ProjectPath * FullTestName) =
769+
// IMPORTANT: the fullname should be last and we should limit the number of substrings
770+
// to prevent incorrently splitting tests names with -- in them
769771
let split =
770-
testId.Split(separator = [| idSeparator |], options = StringSplitOptions.None)
772+
testId.Split(separator = [| idSeparator |], count = 2, options = StringSplitOptions.None)
771773

772774
(split.[0], split.[1])
773775

0 commit comments

Comments
 (0)