diff options
author | Russ Cox <rsc@golang.org> | 2010-02-25 16:01:29 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-02-25 16:01:29 -0800 |
commit | 454796815f7f2e0e614b999f9cc1ef0e3e093b78 (patch) | |
tree | a0a5f67e4a643d3bdadd4e28cee9b0900401b62d /src/pkg/regexp | |
parent | 975cc91983c054595b22502d7b9271a3d3cb828e (diff) | |
download | golang-454796815f7f2e0e614b999f9cc1ef0e3e093b78.tar.gz |
strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports
R=r
CC=golang-dev
http://codereview.appspot.com/224062
Diffstat (limited to 'src/pkg/regexp')
-rw-r--r-- | src/pkg/regexp/all_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/regexp/all_test.go b/src/pkg/regexp/all_test.go index 4570410f9..5b4d0ec12 100644 --- a/src/pkg/regexp/all_test.go +++ b/src/pkg/regexp/all_test.go @@ -161,7 +161,7 @@ func executeTest(t *testing.T, expr string, str string, match []int) { printVec(t, match) } // now try bytes - m = re.Execute(strings.Bytes(str)) + m = re.Execute([]byte(str)) if !equal(m, match) { t.Errorf("Execute failure on %#q matching %q:", expr, str) printVec(t, m) @@ -199,7 +199,7 @@ func matchTest(t *testing.T, expr string, str string, match []int) { t.Errorf("MatchString failure on %#q matching %q: %t should be %t", expr, str, m, len(match) > 0) } // now try bytes - m = re.Match(strings.Bytes(str)) + m = re.Match([]byte(str)) if m != (len(match) > 0) { t.Errorf("Match failure on %#q matching %q: %t should be %t", expr, str, m, len(match) > 0) } @@ -315,7 +315,7 @@ func TestReplaceAll(t *testing.T) { tc.pattern, tc.input, tc.replacement, actual, tc.output) } // now try bytes - actual = string(re.ReplaceAll(strings.Bytes(tc.input), strings.Bytes(tc.replacement))) + actual = string(re.ReplaceAll([]byte(tc.input), []byte(tc.replacement))) if actual != tc.output { t.Errorf("%q.Replace(%q,%q) = %q; want %q", tc.pattern, tc.input, tc.replacement, actual, tc.output) @@ -419,7 +419,7 @@ func TestAllMatches(t *testing.T) { case "matchit": result = make([]string, len(c.input)+1) i := 0 - b := strings.Bytes(c.input) + b := []byte(c.input) for match := range re.AllMatchesIter(b, c.n) { result[i] = string(match) i++ @@ -435,7 +435,7 @@ func TestAllMatches(t *testing.T) { result = result[0:i] case "match": result = make([]string, len(c.input)+1) - b := strings.Bytes(c.input) + b := []byte(c.input) i := 0 for _, match := range re.AllMatches(b, c.n) { result[i] = string(match) |