vim-test / vim-test/vim-test

Incorrect test filter generated for test in nested class with dotnettest

Open
#623 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
3.2k
Forks
411
Avg merge
1h 30m
Merged PRs (30d)
5

Description

In a C# project with xUnit, and the runner configured like so: let test#csharp#runner = 'dotnettest', running TestNearest generates an incorrect test filter when dealing with tests contained in nested classes.

Running dotnet test --list-tests yields the format:

MyNamespace.MyClass+MyNestedClass.MyTestMethod

though vim-test generates the following filter:

FullyQualifiedName=MyNamespace.MyClass.MyNestedClass.MyTestMethod

The difference being the usage of . versus + as the separator for nested classes. As a result, the specified tests fails to be found with the generated test filter.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TestNearest path for the dotnettest runner and compare its generated filter with the names returned by dotnet test --list-tests. Done means nested xUnit test names use + between the containing class and nested class so the specified test is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, vim
Domain
testing, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.