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

Comments

Projects
None yet
3 participants
@rsc
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2012

Comment 1:

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2012

Comment 3:

Labels changed: added size-m.

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2012

Comment 4:

Labels changed: added suggested.

@adg

This comment has been minimized.

Copy link
Contributor

commented Jan 12, 2013

Comment 5:

This issue was closed by revision 3073a02.

Status changed to Fixed.

@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

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.