diff options
author | Rob Pike <r@golang.org> | 2008-06-06 14:27:34 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2008-06-06 14:27:34 -0700 |
commit | f47dd1a887306dbc45a43701b92a93b9ca3cd10a (patch) | |
tree | 22e573d0f4432512779320404d5df24503fc4919 /test/ken/simpconv.go | |
parent | baa3be75b8d3039bd88eab7951096319655a5d45 (diff) | |
download | golang-f47dd1a887306dbc45a43701b92a93b9ca3cd10a.tar.gz |
add ken's tests.
update run to work with multiple directories
SVN=121485
Diffstat (limited to 'test/ken/simpconv.go')
-rw-r--r-- | test/ken/simpconv.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ken/simpconv.go b/test/ken/simpconv.go new file mode 100644 index 000000000..df8242ba3 --- /dev/null +++ b/test/ken/simpconv.go @@ -0,0 +1,23 @@ +// $G $D/$F.go && $L $F.$A && ./$A.out + +// Copyright 2009 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. + +package main + +func +main() +{ + s := vlong(0); + for i:=short(0); i<10; i=i+1 { + s = s + vlong(i); + } + if s != 45 { panic s; } + + s := float(0); + for i:=0; i<10; i=i+1 { + s = s + float(i); + } + if s != 45 { panic s; } +} |