mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: document example with unordered output
Copy the documentation and example from cmd/go. Fixes #18840. Change-Id: Id8022762b48576fb4031de05287d07a6ed23f480 Reviewed-on: https://go-review.googlesource.com/37440 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
98a9aeb009
commit
44bd39c3a4
1 changed files with 21 additions and 7 deletions
|
|
@ -95,6 +95,20 @@
|
||||||
// // goodbye
|
// // goodbye
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
// The comment prefix "Unordered output:" is like "Output:", but matches any
|
||||||
|
// line order:
|
||||||
|
//
|
||||||
|
// func ExamplePerm() {
|
||||||
|
// for _, value := range Perm(4) {
|
||||||
|
// fmt.Println(value)
|
||||||
|
// }
|
||||||
|
// // Unordered output: 4
|
||||||
|
// // 2
|
||||||
|
// // 1
|
||||||
|
// // 3
|
||||||
|
// // 0
|
||||||
|
// }
|
||||||
|
//
|
||||||
// Example functions without output comments are compiled but not executed.
|
// Example functions without output comments are compiled but not executed.
|
||||||
//
|
//
|
||||||
// The naming convention to declare examples for the package, a function F, a type T and
|
// The naming convention to declare examples for the package, a function F, a type T and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue