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

Issue with assertion path when using require package #776

Open
richardlt opened this issue Jun 25, 2019 · 0 comments
Open

Issue with assertion path when using require package #776

richardlt opened this issue Jun 25, 2019 · 0 comments

Comments

@richardlt
Copy link

richardlt commented Jun 25, 2019

Hi,

I found something strange when using the 'require' package, in fact the same problem occurs when using the 'assert' package but not directly in a test func.
I created an example in Go playground: https://play.golang.org/p/kVvhG9rFwD5
As you can see there are two test funcs one is using 'assert' and the other 'require'.
If you run this code you will see that for the test that used require, the path to the failed assertion that is printed is wrong (require.go:157).
I don't take too much time to look at the code but I think this works only when using the 'assert' package directly in the tested package. Maybe because of the way that callers are computed.

Do you have any idea about how this can be solved ?
This feature is really helpful in VSCode for exemple. Because it gives you the absolute path to your assertion and you can simply click on it to open the test file.

Thanks

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