-
Notifications
You must be signed in to change notification settings - Fork 18k
testing/slogtest: add additional tests #62280
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
Comments
Not sure whether this should be a "proposal" or "bug"... 😅 |
I might not be hitting my "if len(attr.Value.Group() == 0" code path because |
There is no new API here so this doesn't have to be a proposal. Thanks. |
slogtest deliberately uses only one or two value kinds so users don't have to write full parsers. I don't want to change that. Same applies to custom types. I don't know what the test would be for error levels. We already check for the presence of the level key. Anything else would be format-dependent.
These might be worth it. I'll give it some thought. (Getting back from vacation.) |
is this a good first issue to work on? im pretty new here and would like to contribute :) |
This test case covers that:
@pohly did you have something else in mind?
I don't know a guaranteed way to generate a bad PC.
This seems do-able: verify that a handler doesn't output an attribute whose key is @AthulMuralidhar This would be a good beginner project. I believe it is relatively straightforward to add this case to |
@jba thx! i'll setup and start getting busy :) - started on a fork here: AthulMuralidhar#1 |
Change https://go.dev/cl/536117 mentions this issue: |
Could you please re-open this? |
Refs golang#62280 Signed-off-by: junya koyama <arukiidou@yahoo.co.jp>
Change https://go.dev/cl/562635 mentions this issue: |
There are some cases that are not covered by testing/slogtest in Go 1.21. It would be nice to increase coverage because then all slog.Handler implementations will benefit.
When looking at coverage of an implement that I was testing with testing/slogtest, I found that the following cases were not covered:
struct { SomeValue int }
PC
PC
(i.e. one whereruntime.CallersFrames
returns nothing)/cc @jba
The text was updated successfully, but these errors were encountered: