aboutsummaryrefslogtreecommitdiff
path: root/test/literal.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-09-04 13:04:11 -0700
committerRuss Cox <rsc@golang.org>2009-09-04 13:04:11 -0700
commitc702bdd8285988ca5365398cc13127fc00c35cc8 (patch)
tree7771e0ef6b565200fe3e05c4c1ec3d364d319e63 /test/literal.go
parentc7d27f88f8935912ed438bccac1191c03878affe (diff)
downloadgo-c702bdd8285988ca5365398cc13127fc00c35cc8.tar.gz
go-c702bdd8285988ca5365398cc13127fc00c35cc8.zip
script for running test programs in interpreter.
tweak test/literal.go to give more information. R=austin DELTA=45 (43 added, 0 deleted, 2 changed) OCL=34381 CL=34398
Diffstat (limited to 'test/literal.go')
-rw-r--r--test/literal.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/literal.go b/test/literal.go
index 673a53c7df..00b7b73426 100644
--- a/test/literal.go
+++ b/test/literal.go
@@ -6,10 +6,15 @@
package main
+var nbad int
+
func assert(cond bool, msg string) {
if !cond {
- print("assertion fail: ", msg, "\n");
- panic(1);
+ if nbad == 0 {
+ print("BUG");
+ }
+ nbad++;
+ print(" ", msg);
}
}
@@ -210,4 +215,8 @@ func main() {
assert(sj0 == sj1, "sj1");
assert(sj0 == sj2, "sj2");
assert(sj0 == sj3, "sj3");
+
+ if nbad > 0 {
+ println()
+ }
}