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

testing: in example, empty output not distinguished from missing output #4485

Closed
rsc opened this issue Dec 4, 2012 · 5 comments
Closed

testing: in example, empty output not distinguished from missing output #4485

rsc opened this issue Dec 4, 2012 · 5 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Dec 4, 2012

An Example test with no // Output comment is not run, not tested.
In contrast, a test with

  // Output:

by itself should be expected to print no output. Instead it is not run.
@adg
Copy link
Contributor

adg commented Dec 5, 2012

Comment 1:

Why would you want to do this? When would a well-written example have no output?

@rsc
Copy link
Contributor Author

rsc commented Dec 6, 2012

Comment 2:

If it's not valid (I disagree) then it should be rejected outright. It
should never just be silently ignored.
I was putting
// Output:
lines at the end of my example code as a reminder to go back and fill
in the output. Since I knew the code did generate output, I assumed
this would make the example test fail, and in the process of failing
tell me what the output was. But instead the tests passed, so I had to
go back and change them all to
// Output: XXX
Russ

@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 3:

Labels changed: added size-m.

@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 4:

Labels changed: added suggested.

@adg
Copy link
Contributor

adg commented Jan 12, 2013

Comment 5:

This issue was closed by revision 3073a02.

Status changed to Fixed.

@rsc rsc added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Jan 12, 2013
@rsc rsc assigned adg Jan 12, 2013
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned adg Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

3 participants