summaryrefslogtreecommitdiff
path: root/src/fmt
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2014-09-18 09:45:58 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2014-09-18 09:45:58 -0700
commit32117b0b02fc7cf19f4660662b794ec6ca3fe48d (patch)
tree694e26ab91e3c00029d3254241b1e35039dccf97 /src/fmt
parentf96d407095d149b2ba930e4d91ba37e19377e8e3 (diff)
downloadgo-32117b0b02fc7cf19f4660662b794ec6ca3fe48d.tar.gz
fmt: fix allocation tests
Converting an integer to an interface{} allocates as of CL 130240043. Fixes issue 8617. LGTM=r R=r CC=golang-codereviews, khr https://codereview.appspot.com/141700043
Diffstat (limited to 'src/fmt')
-rw-r--r--src/fmt/fmt_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fmt/fmt_test.go b/src/fmt/fmt_test.go
index 89dde2b64..a212c9f70 100644
--- a/src/fmt/fmt_test.go
+++ b/src/fmt/fmt_test.go
@@ -864,9 +864,9 @@ var mallocTest = []struct {
}{
{0, `Sprintf("")`, func() { Sprintf("") }},
{1, `Sprintf("xxx")`, func() { Sprintf("xxx") }},
- {1, `Sprintf("%x")`, func() { Sprintf("%x", 7) }},
+ {2, `Sprintf("%x")`, func() { Sprintf("%x", 7) }},
{2, `Sprintf("%s")`, func() { Sprintf("%s", "hello") }},
- {1, `Sprintf("%x %x")`, func() { Sprintf("%x %x", 7, 112) }},
+ {3, `Sprintf("%x %x")`, func() { Sprintf("%x %x", 7, 112) }},
{2, `Sprintf("%g")`, func() { Sprintf("%g", float32(3.14159)) }}, // TODO: Can this be 1?
{1, `Fprintf(buf, "%s")`, func() { mallocBuf.Reset(); Fprintf(&mallocBuf, "%s", "hello") }},
// If the interface value doesn't need to allocate, amortized allocation overhead should be zero.