From 391051631f6118f60751735160d4f5a4b41ba5db Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Wed, 18 Nov 2009 15:24:24 -0800 Subject: remove bytes.Copy replace all calls with calls to copy use copy in regexp and bytes.Buffer R=rsc CC=golang-dev http://codereview.appspot.com/157073 --- src/pkg/bytes/bytes_test.go | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/pkg/bytes/bytes_test.go') diff --git a/src/pkg/bytes/bytes_test.go b/src/pkg/bytes/bytes_test.go index 3e737cb37..1b197e1df 100644 --- a/src/pkg/bytes/bytes_test.go +++ b/src/pkg/bytes/bytes_test.go @@ -172,36 +172,6 @@ func TestSplitAfter(t *testing.T) { } } -type CopyTest struct { - a string; - b string; - n int; - res string; -} - -var copytests = []CopyTest{ - CopyTest{"", "", 0, ""}, - CopyTest{"a", "", 0, "a"}, - CopyTest{"a", "a", 1, "a"}, - CopyTest{"a", "b", 1, "b"}, - CopyTest{"xyz", "abc", 3, "abc"}, - CopyTest{"wxyz", "abc", 3, "abcz"}, - CopyTest{"xyz", "abcd", 3, "abc"}, -} - -func TestCopy(t *testing.T) { - for i := 0; i < len(copytests); i++ { - tt := copytests[i]; - dst := strings.Bytes(tt.a); - n := Copy(dst, strings.Bytes(tt.b)); - result := string(dst); - if result != tt.res || n != tt.n { - t.Errorf(`Copy(%q, %q) = %d, %q; want %d, %q`, tt.a, tt.b, n, result, tt.n, tt.res); - continue; - } - } -} - // Test case for any function which accepts and returns a byte array. // For ease of creation, we write the byte arrays as strings. type StringTest struct { -- cgit v1.2.3