]> Cypherpunks repositories - gostls13.git/commitdiff
bytes: added test case for explode with blank string.
authorScott Lawrence <bytbox@gmail.com>
Wed, 4 Aug 2010 03:33:24 +0000 (13:33 +1000)
committerRob Pike <r@golang.org>
Wed, 4 Aug 2010 03:33:24 +0000 (13:33 +1000)
Tests for the equivalent of the strings.explode("") panic bug (issue 980).

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1850052

src/pkg/bytes/bytes_test.go

index 5d3e9f66a1ee459f17fefd495e06dd2a468eaf29..b91ae5734d1a6d3a9f1426a0a65d8a665e7edcfd 100644 (file)
@@ -212,6 +212,7 @@ type ExplodeTest struct {
 }
 
 var explodetests = []ExplodeTest{
+       ExplodeTest{"", -1, []string{}},
        ExplodeTest{abcd, -1, []string{"a", "b", "c", "d"}},
        ExplodeTest{faces, -1, []string{"☺", "☻", "☹"}},
        ExplodeTest{abcd, 2, []string{"a", "bcd"}},