3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
11 func assertequal(is, shouldbe int, msg string) {
13 print("assertion fail", msg, "\n")
28 assertequal(i, 6, "break")
31 for i := 0; i <= 10; i++ {
34 assertequal(sum, 55, "all three")
37 for i := 0; i <= 10; {
41 assertequal(sum, 55, "only two")
47 assertequal(sum, 99+9, "only one")
50 for i := 0; i <= 10; i++ {
56 assertequal(sum, 1+3+5+7+9, "continue")
59 for i = range [5]struct{}{} {
61 assertequal(i, 4, " incorrect index value after range loop")
68 assertequal(i, 4, " incorrect index value after array with zero size elem range clear")
75 assertequal(i, 4, " incorrect index value after array range clear")