-
Notifications
You must be signed in to change notification settings - Fork 18k
testing: add example to package doc #27840
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
Conversation
This PR (HEAD: e7e57f5) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/137175 to see it. Tip: You can toggle comments from me using the |
The package doc for the testing package doesn't have a simple example demonstrating how to write a test with an expectation. The doc has simple examples for benchmarks, examples, and skipping, and it would be useful for people new to writing tests in Go. Also moved the skip example further down because it references tests and benchmarks but benchmarks haven't been discussed in detail until the next section. Skip is also a less used feature and it seems misplaced to sit so high up in the package documentation. As an example, Skip is used 570 times the Go code repository which is significantly less than Error and Fatal that are used 23,303 times.
This PR (HEAD: 37853b5) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/137175 to see it. Tip: You can toggle comments from me using the |
Message from Gerrit User 5137: Patch Set 2: Run-TryBot+1 Code-Review+2 Thank you for this change Leigh! LGTM. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 5976: Patch Set 2: TryBots beginning. Status page: https://farmer.golang.org/try?commit=102ca3ab Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 5976: Patch Set 2: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 5015: Patch Set 2: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
This PR (HEAD: 2ff9bde) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/137175 to see it. Tip: You can toggle comments from me using the |
Message from Gerrit User 21426: Patch Set 3: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 12446: Uploaded patch set 4: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 5137: Patch Set 4: Cool, thanks! Rob, all yours now for the final approval and then we can submit it. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 5015: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
This PR (HEAD: ba055cc) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/137175 to see it. Tip: You can toggle comments from me using the |
Message from Gerrit User 21426: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 21426: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gerrit User 21426: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Daniel Martí: Patch Set 5: Brad/Ian, could you help us get Leigh's CL merged? I'm not familiar enough with the package to give the final +2. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Brad Fitzpatrick: Patch Set 5: (5 comments) Sorry, I'm kinda burned out on example CLs. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
This PR (HEAD: ba159b1) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/137175 to see it. Tip: You can toggle comments from me using the |
This PR (HEAD: 7357bfd) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/137175 to see it. Tip: You can toggle comments from me using the |
Message from Leigh McCulloch: Patch Set 7: (5 comments)
Hey Brad, thanks for stepping in to review this. I addressed all the feedback. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Rob Pike: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Rob Pike: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Rob Pike: Patch Set 7: Code-Review+1 (1 comment) LGTM. Leaving for Brad Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Emmanuel Odeke: Patch Set 7: Run-TryBot+1
Rob, thanks for the review. Brad just mentioned above that examples aren't currently his favorite to review so given your blessing with the +1, I'll ceremoniously submit it. Brad please feel free to revert. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gobot Gobot: Patch Set 7: TryBots beginning. Status page: https://farmer.golang.org/try?commit=4c1aaa81 Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gobot Gobot: Patch Set 7: Build is still in progress... Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gobot Gobot: Patch Set 7: TryBot-Result-1 3 of 19 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Leigh McCulloch: Patch Set 7:
These failures look unrelated to this CL. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Brad Fitzpatrick: Patch Set 8: Patch Set 7 was rebased Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Brad Fitzpatrick: Patch Set 8: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gobot Gobot: Patch Set 8: TryBots beginning. Status page: https://farmer.golang.org/try?commit=6e976c38 Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
Message from Gobot Gobot: Patch Set 8: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
The package doc for the testing package doesn't have a simple example demonstrating how to write a test with an expectation. The doc has simple examples for benchmarks, examples, and skipping, and it would be useful for people new to writing tests in Go. Also moved the skip example further down because it references tests and benchmarks but benchmarks haven't been discussed in detail until the next section. Skip is also a less used feature and it seems misplaced to sit so high up in the package documentation. As an example, Skip is used 570 times the Go code repository which is significantly less than Error and Fatal that are used 23,303 times. Also changed 'sample' to 'simple' in other places in the package documentation to keep the language used consistent when describing the small examples. Fixes #27839 Change-Id: Ie01a3751986ee61adf2a2f2eda59cc182342baa7 GitHub-Last-Rev: 7357bfd GitHub-Pull-Request: #27840 Reviewed-on: https://go-review.googlesource.com/c/137175 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Emmanuel Odeke <[email protected]>
Message from Brad Fitzpatrick: Patch Set 8: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/137175. |
This PR is being closed because golang.org/cl/137175 has been merged. |
The package doc for the testing package doesn't have a simple example demonstrating how to write a test with an expectation. The doc has simple examples for benchmarks, examples, and skipping, and it would be useful for people new to writing tests in Go. Also moved the skip example further down because it references tests and benchmarks but benchmarks haven't been discussed in detail until the next section. Skip is also a less used feature and it seems misplaced to sit so high up in the package documentation. As an example, Skip is used 570 times the Go code repository which is significantly less than Error and Fatal that are used 23,303 times. Also changed 'sample' to 'simple' in other places in the package documentation to keep the language used consistent when describing the small examples. Fixes #27839 Change-Id: Ie01a3751986ee61adf2a2f2eda59cc182342baa7 GitHub-Last-Rev: 7357bfd GitHub-Pull-Request: #27840 Reviewed-on: https://go-review.googlesource.com/c/137175 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Emmanuel Odeke <[email protected]>
The package doc for the testing package doesn't have a simple
example demonstrating how to write a test with an expectation. The doc
has simple examples for benchmarks, examples, and skipping, and it would be
useful for people new to writing tests in Go.
Also moved the skip example further down because it references tests and
benchmarks but benchmarks haven't been discussed in detail until the
next section. Skip is also a less used feature and it seems misplaced to
sit so high up in the package documentation. As an example, Skip is used
570 times the Go code repository which is significantly less than Error
and Fatal that are used 23,303 times.
Also changed 'sample' to 'simple' in other places in the package documentation
to keep the language used consistent when describing the small examples.
Fixes #27839