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.
7 // Test if statements in various forms.
11 func assertequal(is
, shouldbe
int, msg
string) {
13 print("assertion fail", msg
, "\n")
28 assertequal(count
, 1, "if true")
34 assertequal(count
, 0, "if false")
40 assertequal(count
, 1, "if true one")
47 assertequal(count
, 0, "if false one")
53 assertequal(count
, 1, "if cond")
61 assertequal(count
, 1, "if else true")
69 assertequal(count
, -1, "if else false")
80 assertequal(count
, -1, "if else false var")
92 assertequal(count
, -1, "if else false var outside")