You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: