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

Delta Between Two Patch Sets: src/pkg/fmt/scan_test.go

Issue 4301043: update tree for reflect changes (Closed)
Left Patch Set: Created 13 years ago
Right Patch Set: diff -r f692a5e90f6f https://go.googlecode.com/hg/ Created 13 years 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/fmt/scan.go ('k') | src/pkg/go/ast/print.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 fmt_test 5 package fmt_test
6 6
7 import ( 7 import (
8 "bufio" 8 "bufio"
9 "bytes" 9 "bytes"
10 . "fmt" 10 . "fmt"
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 479 }
480 } 480 }
481 481
482 func TestInf(t *testing.T) { 482 func TestInf(t *testing.T) {
483 for _, s := range []string{"inf", "+inf", "-inf", "INF", "-INF", "+INF", "Inf", "-Inf", "+Inf"} { 483 for _, s := range []string{"inf", "+inf", "-inf", "INF", "-INF", "+INF", "Inf", "-Inf", "+Inf"} {
484 verifyInf(s, t) 484 verifyInf(s, t)
485 } 485 }
486 } 486 }
487 487
488 func testScanfMulti(name string, t *testing.T) { 488 func testScanfMulti(name string, t *testing.T) {
489 » sliceType := reflect.Typeof(make([]interface{}, 1)).(*reflect.SliceType) 489 » sliceType := reflect.Typeof(make([]interface{}, 1))
490 for _, test := range multiTests { 490 for _, test := range multiTests {
491 var r io.Reader 491 var r io.Reader
492 if name == "StringReader" { 492 if name == "StringReader" {
493 r = strings.NewReader(test.text) 493 r = strings.NewReader(test.text)
494 } else { 494 } else {
495 r = newReader(test.text) 495 r = newReader(test.text)
496 } 496 }
497 n, err := Fscanf(r, test.format, test.in...) 497 n, err := Fscanf(r, test.format, test.in...)
498 if err != nil { 498 if err != nil {
499 if test.err == "" { 499 if test.err == "" {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 b.ResetTimer() 848 b.ResetTimer()
849 ints := makeInts(intCount) 849 ints := makeInts(intCount)
850 var r RecursiveInt 850 var r RecursiveInt
851 for i := b.N - 1; i >= 0; i-- { 851 for i := b.N - 1; i >= 0; i-- {
852 buf := bytes.NewBuffer(ints) 852 buf := bytes.NewBuffer(ints)
853 b.StartTimer() 853 b.StartTimer()
854 Fscan(buf, &r) 854 Fscan(buf, &r)
855 b.StopTimer() 855 b.StopTimer()
856 } 856 }
857 } 857 }
LEFTRIGHT

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