From cdc700c29a00bc78660cc6725ec9b4ef621c39a1 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 14 Jun 2010 17:42:31 -0700 Subject: fmt.Printf: write tests for %T. Fix a bug that caused it to ignore field widths. R=rsc CC=golang-dev http://codereview.appspot.com/1704041 --- src/pkg/fmt/fmt_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pkg/fmt/fmt_test.go') diff --git a/src/pkg/fmt/fmt_test.go b/src/pkg/fmt/fmt_test.go index d9bb167dd..e48e874b1 100644 --- a/src/pkg/fmt/fmt_test.go +++ b/src/pkg/fmt/fmt_test.go @@ -314,6 +314,12 @@ var fmttests = []fmtTest{ fmtTest{"%v", renamedComplex64(3 + 4i), "(3+4i)"}, fmtTest{"%v", renamedComplex128(4 - 3i), "(4-3i)"}, + // %T + fmtTest{"%T", (4 - 3i), "complex"}, + fmtTest{"%T", renamedComplex128(4 - 3i), "fmt_test.renamedComplex128"}, + fmtTest{"%T", intVal, "int"}, + fmtTest{"%6T", &intVal, " *int"}, + // erroneous things fmtTest{"%d", "hello", "%d(string=hello)"}, fmtTest{"no args", "hello", "no args?(extra string=hello)"}, -- cgit v1.2.3