]> Cypherpunks repositories - gostls13.git/commitdiff
put array test in table, with TODO to fix when arrays work in interfaces.
authorRob Pike <r@golang.org>
Tue, 23 Dec 2008 17:34:38 +0000 (09:34 -0800)
committerRob Pike <r@golang.org>
Tue, 23 Dec 2008 17:34:38 +0000 (09:34 -0800)
TBR=rsc
OCL=21766
CL=21766

src/lib/fmt/fmt_test.go

index 5b016ca4c2a8c0155bec5bc09e3daa715578d70f..8eb70b35199d1f4cf2336ab449c972c0fdcdeee5 100644 (file)
@@ -28,6 +28,8 @@ type FmtTest struct {
 
 const B32 uint32 = 1<<32 - 1
 const B64 uint64 = 1<<64 - 1
+var array = []int{1, 2, 3, 4, 5}
+
 
 var fmttests = []FmtTest{
        // basic string
@@ -77,6 +79,12 @@ var fmttests = []FmtTest{
        FmtTest{ "% d",         12345,  " 12345" },
        FmtTest{ "% d",         -12345, "-12345" },
 
+       // arrays
+       // TODO: when arrays work in interfaces, enable this line
+       // and delete the TestArrayPrinter routine below
+       // FmtTest{ "%v",               array,                  "[1 2 3 4 5]" },
+       FmtTest{ "%v",          &array,                 "&[1 2 3 4 5]" },
+
        // old test/fmt_test.go
        FmtTest{ "%d",          1234,                   "1234" },
        FmtTest{ "%d",          -1234,                  "-1234" },