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

Doctest test cases with a comma in the name are skipped #224

Closed
4 tasks done
wilhem-meignan opened this issue Oct 2, 2020 · 4 comments
Closed
4 tasks done

Doctest test cases with a comma in the name are skipped #224

wilhem-meignan opened this issue Oct 2, 2020 · 4 comments

Comments

@wilhem-meignan
Copy link

wilhem-meignan commented Oct 2, 2020

Checklist

  • The issue is about this extension and NOT about a fork.
  • Check the known issues list.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue

Describe the bug

Test cases containing a comma in the name are skipped.

To Reproduce

Use those test cases:

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>

TEST_CASE("example")
{
CHECK(true);
}

TEST_CASE("example,")
{
CHECK(true);
}

Open the "Test" view from the Menu Bar. Click on the play icon at the top to run all tests.

Expected: all tests are run.
Observed: the second test with a comma in the name is skipped.

  • Extension Version: 3.4.1
  • VS Code Version: 1.49.2
  • Catch2 / Google Test / DOCTest Version: 2.3.7 (also happens with 2.4.0)
  • OS Type and Version: Windows Locally / Linux Remotely
  • Using remote-ssh/docker/wsl?: Remote SSH

Log (optional but recommended)

@matepek
Copy link
Owner

matepek commented Oct 2, 2020

Hello,

It seems to me doctest doesn't support escaping , which is a special character

I will release a workaround but its not bulletproof. If you really need this feature request it from doctest developer at first.

Thanks for the report though.

@matepek matepek closed this as completed Oct 2, 2020
@wilhem-meignan
Copy link
Author

Hi Mate,

Thanks for the quick feedback. When running the test binary from the command line I get:

[doctest] test cases: 2 | 2 passed | 0 failed | 0 skipped

Both tests are run and none are skipped. So I though this must be an issue specific to the VS Code Extension.

@matepek
Copy link
Owner

matepek commented Oct 2, 2020

Yeah, I see that. For parallelization the extension directly calls the test by name and since the , is the separator it has to be escaped. I released a quick fix but that unable to make a difference between exmaple, and exampleX. So if you run the first it will run both.

@wilhem-meignan
Copy link
Author

Wow, that was fast! Thanks for the update!

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

2 participants