Commit b90b4157 authored by Rob Pike's avatar Rob Pike

put array test in table, with TODO to fix when arrays work in interfaces.

TBR=rsc
OCL=21766
CL=21766
parent b0d62676
...@@ -28,6 +28,8 @@ type FmtTest struct { ...@@ -28,6 +28,8 @@ type FmtTest struct {
const B32 uint32 = 1<<32 - 1 const B32 uint32 = 1<<32 - 1
const B64 uint64 = 1<<64 - 1 const B64 uint64 = 1<<64 - 1
var array = []int{1, 2, 3, 4, 5}
var fmttests = []FmtTest{ var fmttests = []FmtTest{
// basic string // basic string
...@@ -77,6 +79,12 @@ var fmttests = []FmtTest{ ...@@ -77,6 +79,12 @@ var fmttests = []FmtTest{
FmtTest{ "% d", 12345, " 12345" }, FmtTest{ "% d", 12345, " 12345" },
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 // old test/fmt_test.go
FmtTest{ "%d", 1234, "1234" }, FmtTest{ "%d", 1234, "1234" },
FmtTest{ "%d", -1234, "-1234" }, FmtTest{ "%d", -1234, "-1234" },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment