Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - File scoped namespaces in MSTEST don't work with adapter #114

Open
ADIX7 opened this issue Jul 25, 2024 · 0 comments
Open

[BUG] - File scoped namespaces in MSTEST don't work with adapter #114

ADIX7 opened this issue Jul 25, 2024 · 0 comments

Comments

@ADIX7
Copy link

ADIX7 commented Jul 25, 2024

If a test file contains file scoped namespace in a mstest project, tests are reported failing although they do pass. As it turns out at the "intermediate results" step the test_name includes the full namespace but at the "MSTest test Nodes" the full_name only containts the class and method name, not the namespace. When converting the file to block style namespace the tests are correctly reported as passing.

By changing in mstest/init.lua this:

local is_match = #result_test_name == #node_data.full_name
    and string.find(result_test_name, node_data.full_name, 0, true)

to this:

local is_match = string.find(result_test_name, node_data.full_name, 0, true) ~= nil

fixes the problem, so it is indeed the missing namespace.

DarkKronicle added a commit to DarkKronicle/neotest-dotnet that referenced this issue Aug 26, 2024
- Issafalcon#114
- I don't really know the implications of this because I am doing simple
  dotnet projects. So this fix works good enough for me, but probably
  not for the full plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant