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

Side by Side Diff: src/pkg/strconv/fp_test.go

Issue 5311067: code review 5311067: pkg: remove .String() from some print arguments (Closed)
Patch Set: diff -r eb6fbf796acc https://go.googlecode.com/hg/ Created 13 years, 5 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/pkg/smtp/smtp_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 strconv_test 5 package strconv_test
6 6
7 import ( 7 import (
8 "bufio" 8 "bufio"
9 "fmt" 9 "fmt"
10 "os" 10 "os"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 f1, err1 := strconv.Atof32(s) 89 f1, err1 := strconv.Atof32(s)
90 if err1 != nil { 90 if err1 != nil {
91 return 0, false 91 return 0, false
92 } 92 }
93 return f1, true 93 return f1, true
94 } 94 }
95 95
96 func TestFp(t *testing.T) { 96 func TestFp(t *testing.T) {
97 f, err := os.Open("testfp.txt") 97 f, err := os.Open("testfp.txt")
98 if err != nil { 98 if err != nil {
99 » » t.Fatal("testfp: open testfp.txt:", err.String()) 99 » » t.Fatal("testfp: open testfp.txt:", err)
100 } 100 }
101 defer f.Close() 101 defer f.Close()
102 102
103 b := bufio.NewReader(f) 103 b := bufio.NewReader(f)
104 104
105 lineno := 0 105 lineno := 0
106 for { 106 for {
107 line, err2 := b.ReadString('\n') 107 line, err2 := b.ReadString('\n')
108 if err2 == os.EOF { 108 if err2 == os.EOF {
109 break 109 break
(...skipping 30 matching lines...) Expand all
140 } 140 }
141 s = fmt.Sprintf(a[1], v1) 141 s = fmt.Sprintf(a[1], v1)
142 v = float64(v1) 142 v = float64(v1)
143 } 143 }
144 if s != a[3] { 144 if s != a[3] {
145 t.Error("testfp.txt:", lineno, ": ", a[0], " ", a[1], " ", a[2], " (", v, ") ", 145 t.Error("testfp.txt:", lineno, ": ", a[0], " ", a[1], " ", a[2], " (", v, ") ",
146 "want ", a[3], " got ", s) 146 "want ", a[3], " got ", s)
147 } 147 }
148 } 148 }
149 } 149 }
OLDNEW
« no previous file with comments | « src/pkg/smtp/smtp_test.go ('k') | no next file » | no next file with comments »

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