diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
commit | 4cecda6c347bd6902b960c6a35a967add7070b0d (patch) | |
tree | a462e224ff41ec9f3eb1a0b6e815806f9e8804ad /src/pkg/io/multi_test.go | |
parent | 6c7ca6e4d4e26e4c8cbe0d183966011b3b088a0a (diff) | |
download | golang-4cecda6c347bd6902b960c6a35a967add7070b0d.tar.gz |
Imported Upstream version 2012.01.27upstream-weekly/2012.01.27
Diffstat (limited to 'src/pkg/io/multi_test.go')
-rw-r--r-- | src/pkg/io/multi_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pkg/io/multi_test.go b/src/pkg/io/multi_test.go index 1b3589dde..eb717f7bc 100644 --- a/src/pkg/io/multi_test.go +++ b/src/pkg/io/multi_test.go @@ -5,11 +5,10 @@ package io_test import ( - . "io" "bytes" "crypto/sha1" "fmt" - "os" + . "io" "strings" "testing" ) @@ -26,7 +25,7 @@ func TestMultiReader(t *testing.T) { buf = make([]byte, 20) tests() } - expectRead := func(size int, expected string, eerr os.Error) { + expectRead := func(size int, expected string, eerr error) { nread++ n, gerr := mr.Read(buf[0:size]) if n != len(expected) { @@ -48,13 +47,13 @@ func TestMultiReader(t *testing.T) { expectRead(2, "fo", nil) expectRead(5, "o ", nil) expectRead(5, "bar", nil) - expectRead(5, "", os.EOF) + expectRead(5, "", EOF) }) withFooBar(func() { expectRead(4, "foo ", nil) expectRead(1, "b", nil) expectRead(3, "ar", nil) - expectRead(1, "", os.EOF) + expectRead(1, "", EOF) }) withFooBar(func() { expectRead(5, "foo ", nil) @@ -78,7 +77,7 @@ func TestMultiWriter(t *testing.T) { t.Errorf("unexpected error: %v", err) } - sha1hex := fmt.Sprintf("%x", sha1.Sum()) + sha1hex := fmt.Sprintf("%x", sha1.Sum(nil)) if sha1hex != "01cb303fa8c30a64123067c5aa6284ba7ec2d31b" { t.Error("incorrect sha1 value") } |