1
0
mirror of https://github.com/golang/go synced 2024-11-14 22:50:27 -07:00

bytes: skip TestNewBufferShallow if optimization is disabled

TestNewBufferShallow should be skipped if optimization is disabled.

It is currently failing on no-opt builders.

Change-Id: Ib5e62022a56a4e5f158f247d69a6229d2cb4d99e
Reviewed-on: https://go-review.googlesource.com/c/go/+/581915
Auto-Submit: Than McIntosh <thanm@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joedian Reid <joedian@google.com>
This commit is contained in:
qmuntal 2024-04-26 09:38:44 +02:00 committed by Gopher Robot
parent 5419f652b6
commit 5ff0b53174

View File

@ -7,6 +7,7 @@ package bytes_test
import ( import (
. "bytes" . "bytes"
"fmt" "fmt"
"internal/testenv"
"io" "io"
"math/rand" "math/rand"
"strconv" "strconv"
@ -100,6 +101,7 @@ var buf Buffer
// should not result in any allocations. // should not result in any allocations.
// This can be used to reset the underlying []byte of an existing Buffer. // This can be used to reset the underlying []byte of an existing Buffer.
func TestNewBufferShallow(t *testing.T) { func TestNewBufferShallow(t *testing.T) {
testenv.SkipIfOptimizationOff(t)
n := testing.AllocsPerRun(1000, func() { n := testing.AllocsPerRun(1000, func() {
buf = *NewBuffer(testBytes) buf = *NewBuffer(testBytes)
}) })