diff options
| author | Rob Pike <r@golang.org> | 2012-01-29 11:07:25 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2012-01-29 11:07:25 -0800 |
| commit | 71d83b72efe3e20ce6b0ab96226873074afe24be (patch) | |
| tree | 885febc20e75f037c6a9f8a76cb31aa8d7774378 /src/cmd/fix/stringssplit_test.go | |
| parent | 108961b21649cd7c2d8f9650542b2228fea09613 (diff) | |
| download | go-71d83b72efe3e20ce6b0ab96226873074afe24be.tar.xz | |
cmd/go: add go tools to rearrangement
fix, vet
yacc is also fixed (it was wrong before)
All that's left is the commands used during compilation
This looks like a huge CL, but it's almost all file renames.
The action is in cmd/go/pkg.go, the Makefiles, and .../doc.go.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5595044
Diffstat (limited to 'src/cmd/fix/stringssplit_test.go')
| -rw-r--r-- | src/cmd/fix/stringssplit_test.go | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/cmd/fix/stringssplit_test.go b/src/cmd/fix/stringssplit_test.go new file mode 100644 index 0000000000..fa42b1bea9 --- /dev/null +++ b/src/cmd/fix/stringssplit_test.go @@ -0,0 +1,51 @@ +// Copyright 2011 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. + +package main + +func init() { + addTestCases(stringssplitTests, stringssplit) +} + +var stringssplitTests = []testCase{ + { + Name: "stringssplit.0", + In: `package main + +import ( + "bytes" + "strings" +) + +func f() { + bytes.Split(a, b, c) + bytes.Split(a, b, -1) + bytes.SplitAfter(a, b, c) + bytes.SplitAfter(a, b, -1) + strings.Split(a, b, c) + strings.Split(a, b, -1) + strings.SplitAfter(a, b, c) + strings.SplitAfter(a, b, -1) +} +`, + Out: `package main + +import ( + "bytes" + "strings" +) + +func f() { + bytes.SplitN(a, b, c) + bytes.Split(a, b) + bytes.SplitAfterN(a, b, c) + bytes.SplitAfter(a, b) + strings.SplitN(a, b, c) + strings.Split(a, b) + strings.SplitAfterN(a, b, c) + strings.SplitAfter(a, b) +} +`, + }, +} |
