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

Delta Between Two Patch Sets: src/pkg/testing/testing.go

Issue 4661051: code review 4661051: strings.Split: make the default to split all. (Closed)
Left Patch Set: Created 12 years, 9 months ago
Right Patch Set: diff -r eaa696629d4d https://go.googlecode.com/hg/ Created 12 years, 9 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/template/parse.go ('k') | src/pkg/unicode/maketables.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 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 testing provides support for automated testing of Go packages. 5 // Package testing provides support for automated testing of Go packages.
6 // It is intended to be used in concert with the ``gotest'' utility, which autom ates 6 // It is intended to be used in concert with the ``gotest'' utility, which autom ates
7 // execution of any function of the form 7 // execution of any function of the form
8 // func TestXxx(*testing.T) 8 // func TestXxx(*testing.T)
9 // where Xxx can be any alphanumeric string (but the first letter must not be in 9 // where Xxx can be any alphanumeric string (but the first letter must not be in
10 // [a-z]) and serves to identify the test routine. 10 // [a-z]) and serves to identify the test routine.
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 // alarm is called if the timeout expires. 281 // alarm is called if the timeout expires.
282 func alarm() { 282 func alarm() {
283 panic("test timed out") 283 panic("test timed out")
284 } 284 }
285 285
286 func parseCpuList() { 286 func parseCpuList() {
287 if len(*cpuListStr) == 0 { 287 if len(*cpuListStr) == 0 {
288 cpuList = append(cpuList, runtime.GOMAXPROCS(-1)) 288 cpuList = append(cpuList, runtime.GOMAXPROCS(-1))
289 } else { 289 } else {
290 » » for _, val := range strings.Split(*cpuListStr, ",", -1) { 290 » » for _, val := range strings.Split(*cpuListStr, ",") {
291 cpu, err := strconv.Atoi(val) 291 cpu, err := strconv.Atoi(val)
292 if err != nil || cpu <= 0 { 292 if err != nil || cpu <= 0 {
293 println("invalid value for -test.cpu") 293 println("invalid value for -test.cpu")
294 os.Exit(1) 294 os.Exit(1)
295 } 295 }
296 cpuList = append(cpuList, cpu) 296 cpuList = append(cpuList, cpu)
297 } 297 }
298 } 298 }
299 } 299 }
LEFTRIGHT

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