]> Cypherpunks repositories - gostls13.git/commitdiff
strconv: document and test True and False for Atob
authorRobert Hencke <robert.hencke@gmail.com>
Fri, 13 May 2011 05:00:50 +0000 (22:00 -0700)
committerRob Pike <r@golang.org>
Fri, 13 May 2011 05:00:50 +0000 (22:00 -0700)
R=golang-dev
CC=golang-dev
https://golang.org/cl/4535057

src/pkg/strconv/atob.go
src/pkg/strconv/atob_test.go

index 69fa2292a18000124bb829939164731f5b7e77c6..98ce750798da4d2ca086a396a556616d0ce36d72 100644 (file)
@@ -7,8 +7,8 @@ package strconv
 import "os"
 
 // Atob returns the boolean value represented by the string.
-// It accepts 1, t, T, TRUE, true, 0, f, F, FALSE, false.  Any other value returns
-// an error.
+// It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
+// Any other value returns an error.
 func Atob(str string) (value bool, err os.Error) {
        switch str {
        case "1", "t", "T", "true", "TRUE", "True":
index 497df5b18d80bbc3c32c7101f38fb539701d5979..541e60d1e9e47d8d765b0314e1b0a3fd5b8026d3 100644 (file)
@@ -24,11 +24,13 @@ var atobtests = []atobTest{
        {"F", false, nil},
        {"FALSE", false, nil},
        {"false", false, nil},
+       {"False", false, nil},
        {"1", true, nil},
        {"t", true, nil},
        {"T", true, nil},
        {"TRUE", true, nil},
        {"true", true, nil},
+       {"True", true, nil},
 }
 
 func TestAtob(t *testing.T) {