| // Copyright 2015 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. |
| // chan_ssa.go tests chan operations. |
| func lenChan_ssa(v chan int) int { |
| func capChan_ssa(v chan int) int { |
| if want, got := 3, lenChan_ssa(v); got != want { |
| fmt.Printf("expected len(chan) = %d, got %d", want, got) |
| if want, got := 0, lenChan_ssa(v); got != want { |
| fmt.Printf("expected len(nil) = %d, got %d", want, got) |
| if want, got := 25, capChan_ssa(v); got != want { |
| fmt.Printf("expected cap(chan) = %d, got %d", want, got) |
| if want, got := 0, capChan_ssa(v); got != want { |
| fmt.Printf("expected cap(nil) = %d, got %d", want, got) |