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

go sub tests names needs to be regex quoted #420

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

vcraescu
Copy link
Contributor

@vcraescu vcraescu commented Jan 18, 2024

go test -v ./domain/transforming/transformers/internal/denom -run="^\QTest_Shorten\E$"/"^\Qinterval [1, 500] - step 1\E$" 

that's how it is supposed to be able to run any sub-test.

@vcraescu
Copy link
Contributor Author

i have no idea why the tests are failing because a lot of them are not even related.

@vcraescu
Copy link
Contributor Author

@ray-x can you help me a lil bit?

@vcraescu
Copy link
Contributor Author

@ray-x 👋

@ray-x
Copy link
Owner

ray-x commented Feb 2, 2024

Thanks for the PR
I think you need to update the lua/test/go_test_spec.lua
e.g

    eq({ 'go', 'test', './coverage', '-run', [['^Test_branch$'/"b10"]] }, cmd)

may need to be updated to something like

    eq({ 'go', 'test', './coverage', '-run', [['^\QTest_branch\E$'/"\Qb10\E"]] }, cmd)

Also, I do not think changing Test_branch to \QTest_branch\E helps much. I agree the sub-case name change could help.

@vcraescu
Copy link
Contributor Author

vcraescu commented Feb 2, 2024

Thanks for the PR I think you need to update the lua/test/go_test_spec.lua e.g

    eq({ 'go', 'test', './coverage', '-run', [['^Test_branch$'/"b10"]] }, cmd)

may need to be updated to something like

    eq({ 'go', 'test', './coverage', '-run', [['^\QTest_branch\E$'/"\Qb10\E"]] }, cmd)

Also, I do not think changing Test_branch to \QTest_branch\E helps much. I agree the sub-case name change could help.

Yes, I agree with the method name but it's how JetBrains runs the tests so I thought it might be a reason that might not be obvious to me at this moment. :)

@vcraescu
Copy link
Contributor Author

vcraescu commented Feb 6, 2024

@ray-x can you review this please?

@ray-x
Copy link
Owner

ray-x commented Feb 8, 2024

Thanks for your PR update.
Could you update at least one of the test cases in file branch_test.go so it includes special regex characters?
one example is name: "b10" to name: "b10 [step 1..3] and also update the go_test_spec.lua.

@vcraescu
Copy link
Contributor Author

vcraescu commented Feb 8, 2024

@ray-x I think it needs a kick?

Copy link
Owner

@ray-x ray-x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@ray-x ray-x merged commit 9ccb577 into ray-x:master Feb 9, 2024
0 of 3 checks passed
weirdgiraffe pushed a commit to weirdgiraffe/go.nvim that referenced this pull request Feb 19, 2024
* go sub tests names needs to be regex quoted

* fix lua tests

* create test scenario
weirdgiraffe pushed a commit to weirdgiraffe/go.nvim that referenced this pull request Feb 19, 2024
* go sub tests names needs to be regex quoted

* fix lua tests

* create test scenario
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

Successfully merging this pull request may close these issues.

2 participants