Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(109)

Unified Diff: src/cmd/go/testdata/example1_test.go

Issue 7229071: code review 7229071: cmd/go: run examples in source order, not name order (Closed)
Patch Set: diff -r 8faf9010cd77 https://code.google.com/p/go/ Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/go/test.go ('k') | src/cmd/go/testdata/example2_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/go/testdata/example1_test.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/cmd/go/testdata/example1_test.go
@@ -0,0 +1,23 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Make sure that go test runs Example_Z before Example_A, preserving source order.
+
+package p
+
+import "fmt"
+
+var n int
+
+func Example_Z() {
+ n++
+ fmt.Println(n)
+ // Output: 1
+}
+
+func Example_A() {
+ n++
+ fmt.Println(n)
+ // Output: 2
+}
« no previous file with comments | « src/cmd/go/test.go ('k') | src/cmd/go/testdata/example2_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b