| // 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. |
| // Test interface assignment. |
| func (p *Print) dop() string { |
| r := " print " + string(p.whoami + '0') |
| return r + p.put.puts("abc"); |
| func (b *Bio) puts(s string) string { |
| r := " bio " + string(b.whoami + '0') |
| return r + b.put.puts(s); |
| func (f *File) puts(s string) string { |
| return " file " + string(f.whoami + '0') + " -- " + s |
| expected := " print 1 bio 2 file 3 -- abc" |
| panic(r + " != " + expected) |