Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Side by Side Diff: src/runtime/string_test.go

Issue 152570049: [dev.power64] code review 152570049: all: merge default into dev.power64 (Closed)
Patch Set: diff -r 36f7fc9495481ed67a159eea0eb2fac35b7c46a5 https://code.google.com/p/go Created 10 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/string.go ('k') | src/runtime/stubs.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package runtime_test 5 package runtime_test
6 6
7 import ( 7 import (
8 "runtime" 8 "runtime"
9 "strings" 9 "strings"
10 "testing" 10 "testing"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 import "strings" 138 import "strings"
139 func main() { 139 func main() {
140 s0 := strings.Repeat("0", 1<<10) 140 s0 := strings.Repeat("0", 1<<10)
141 s1 := strings.Repeat("1", 1<<10) 141 s1 := strings.Repeat("1", 1<<10)
142 s2 := strings.Repeat("2", 1<<10) 142 s2 := strings.Repeat("2", 1<<10)
143 s3 := strings.Repeat("3", 1<<10) 143 s3 := strings.Repeat("3", 1<<10)
144 s := s0 + s1 + s2 + s3 144 s := s0 + s1 + s2 + s3
145 panic(s) 145 panic(s)
146 } 146 }
147 ` 147 `
148
149 func TestGostringnocopy(t *testing.T) {
150 max := *runtime.Maxstring
151 b := make([]byte, max+10)
152 for i := uintptr(0); i < max+9; i++ {
153 b[i] = 'a'
154 }
155 _ = runtime.Gostringnocopy(&b[0])
156 newmax := *runtime.Maxstring
157 if newmax != max+9 {
158 t.Errorf("want %d, got %d", max+9, newmax)
159 }
160 }
OLDNEW
« no previous file with comments | « src/runtime/string.go ('k') | src/runtime/stubs.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b