forked from golang/exp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
slog/internal/buffer: don't run alloc test with race detector
Fixes golang/go#54978. Change-Id: I42d1f952e7f9f8469f640763fc3363d087583918 Reviewed-on: https://go-review.googlesource.com/c/exp/+/431056 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Run-TryBot: Jonathan Amsterdam <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2022 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build !race | ||
|
||
package buffer | ||
|
||
import "testing" | ||
|
||
func TestAlloc(t *testing.T) { | ||
got := int(testing.AllocsPerRun(5, func() { | ||
b := New() | ||
defer b.Free() | ||
b.WriteString("not 1K worth of bytes") | ||
})) | ||
if got != 0 { | ||
t.Errorf("got %d allocs, want 0", got) | ||
} | ||
} |