summaryrefslogtreecommitdiff
path: root/src/pkg/bytes/bytes_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-11-18 15:24:24 -0800
committerRob Pike <r@golang.org>2009-11-18 15:24:24 -0800
commit391051631f6118f60751735160d4f5a4b41ba5db (patch)
treea54bad89b8447ed713d40539471ce8d1b9f811ff /src/pkg/bytes/bytes_test.go
parente97248aec165fe74b5b765813d8d8f9e44790910 (diff)
downloadgolang-391051631f6118f60751735160d4f5a4b41ba5db.tar.gz
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
Diffstat (limited to 'src/pkg/bytes/bytes_test.go')
-rw-r--r--src/pkg/bytes/bytes_test.go30
1 files changed, 0 insertions, 30 deletions
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 {