aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/string_test.go')
-rw-r--r--src/runtime/string_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/string_test.go b/src/runtime/string_test.go
index 6aab0ed764..4ee32ea671 100644
--- a/src/runtime/string_test.go
+++ b/src/runtime/string_test.go
@@ -82,6 +82,13 @@ func BenchmarkCompareStringBig(b *testing.B) {
b.SetBytes(int64(len(s1)))
}
+func BenchmarkConcatStringAndBytes(b *testing.B) {
+ s1 := []byte("Gophers!")
+ for i := 0; i < b.N; i++ {
+ _ = "Hello " + string(s1)
+ }
+}
+
var stringdata = []struct{ name, data string }{
{"ASCII", "01234567890"},
{"Japanese", "日本語日本語日本語"},