-
Notifications
You must be signed in to change notification settings - Fork 555
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
Ability to specify comment when asserting with So() #355
Comments
You know about |
Ok, thanks for clarifying. I've struggled with this same frustrating problem. Modifying the signature to the So call is a pretty significant change that would ripple all the way into every function of the assertions package (if you want the message to appear along with the line:file info. That's a lot to work through. So, while I'm not completely against this, I'm not sold on it yet either. |
Maybe instead variation on Convey() (with name like ConveySimple, or ConveyOne or sth) that would work like Convey with single So:
That would cut on convey blocks that are just single assertion without cutting down on readability |
Yeah, we've actually thought about that too at one point. It was complicated when we discussed it at that time and the internals of the convey package have been almost completely rewritten since then so I don't think I could estimate the complexity of the task. Perhaps you would consider creating a simple assertion function using the assertions package by itself (without the convey package)?
|
Well, just adding
(and ofc adding to to Also why there is code in |
Good question about the doc.go file. The original thinking with that file was to put all the exported names there. The project has since grown. Maybe that file should be called convey.go now... You are welcome to move forward with what you are proposing, taking care to not cause any breaking changes to the exported API/contract. |
The |
When checking if multiple fields in output struct are correct it would be useful to have ability to add comment to So() instead of just getting a line number of failed assert eg.
will just generate failures with only line number as an info, to get meaningful feedback I have to use much more verbose (and IMO much less readable) format:
It would be nice if it would be possible just to have something like
and have that last field as a comment next to filename:line
The text was updated successfully, but these errors were encountered: