See disccusion in CL 612955.
Change-Id: I2de582321648f1798929ffb80d2f087e41146ead
Reviewed-on: https://go-review.googlesource.com/c/go/+/613315
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
}
}
+func TestRuneCountNonASCIIAllocation(t *testing.T) {
+ if n := testing.AllocsPerRun(10, func() {
+ s := []byte("日本語日本語日本語日")
+ _ = RuneCount(s)
+ }); n > 0 {
+ t.Errorf("unexpected RuneCount allocation, got %v, want 0", n)
+ }
+}
+
type RuneLenTest struct {
r rune
size int