mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
strings: fix Split("", "", -1)
Fixes #980. Made it return an empty array, rather than crash. Added relevant test cases to strings. R=golang-dev, r CC=golang-dev https://golang.org/cl/1914041
This commit is contained in:
parent
b6c2bf7127
commit
0cd8777255
2 changed files with 5 additions and 2 deletions
|
|
@ -109,6 +109,7 @@ type ExplodeTest struct {
|
|||
}
|
||||
|
||||
var explodetests = []ExplodeTest{
|
||||
ExplodeTest{"", -1, []string{}},
|
||||
ExplodeTest{abcd, 4, []string{"a", "b", "c", "d"}},
|
||||
ExplodeTest{faces, 3, []string{"☺", "☻", "☹"}},
|
||||
ExplodeTest{abcd, 2, []string{"a", "bcd"}},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue