Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
64023e7b
Commit
64023e7b
authored
Nov 20, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a few Errorfs should have been Error
R=rsc DELTA=6 (0 added, 0 deleted, 6 changed) OCL=19662 CL=19664
parent
fcdcf33a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
testfp.go
src/lib/strconv/testfp.go
+4
-4
testftoa.go
src/lib/strconv/testftoa.go
+2
-2
No files found.
src/lib/strconv/testfp.go
View file @
64023e7b
...
...
@@ -118,7 +118,7 @@ export func TestFp(t *testing.T) {
}
a
:=
strings
.
split
(
line
,
" "
);
if
len
(
a
)
!=
4
{
t
.
Error
f
(
"testfp.txt:"
,
lineno
,
": wrong field count
\n
"
);
t
.
Error
(
"testfp.txt:"
,
lineno
,
": wrong field count
\n
"
);
continue
;
}
var
s
string
;
...
...
@@ -128,21 +128,21 @@ export func TestFp(t *testing.T) {
var
ok
bool
;
v
,
ok
=
myatof64
(
a
[
2
]);
if
!
ok
{
t
.
Error
f
(
"testfp.txt:"
,
lineno
,
": cannot atof64 "
,
a
[
2
]);
t
.
Error
(
"testfp.txt:"
,
lineno
,
": cannot atof64 "
,
a
[
2
]);
continue
;
}
s
=
fmt
.
sprintf
(
a
[
1
],
v
);
case
"float32"
:
v1
,
ok
:=
myatof32
(
a
[
2
]);
if
!
ok
{
t
.
Error
f
(
"testfp.txt:"
,
lineno
,
": cannot atof32 "
,
a
[
2
]);
t
.
Error
(
"testfp.txt:"
,
lineno
,
": cannot atof32 "
,
a
[
2
]);
continue
;
}
s
=
fmt
.
sprintf
(
a
[
1
],
v1
);
v
=
float64
(
v1
);
}
if
s
!=
a
[
3
]
{
t
.
Error
f
(
"testfp.txt:"
,
lineno
,
": "
,
a
[
0
],
" "
,
a
[
1
],
" "
,
a
[
2
],
" ("
,
v
,
") "
,
t
.
Error
(
"testfp.txt:"
,
lineno
,
": "
,
a
[
0
],
" "
,
a
[
1
],
" "
,
a
[
2
],
" ("
,
v
,
") "
,
"want "
,
a
[
3
],
" got "
,
s
,
"
\n
"
);
}
//else print("testfp.txt:", lineno, ": worked! ", s, "\n");
...
...
src/lib/strconv/testftoa.go
View file @
64023e7b
...
...
@@ -98,12 +98,12 @@ export func TestFtoa(t *testing.T) {
test
:=
&
ftests
[
i
];
s
:=
strconv
.
ftoa64
(
test
.
f
,
test
.
fmt
,
test
.
prec
);
if
s
!=
test
.
s
{
t
.
Error
f
(
"test"
,
test
.
f
,
string
(
test
.
fmt
),
test
.
prec
,
"want"
,
test
.
s
,
"got"
,
s
);
t
.
Error
(
"test"
,
test
.
f
,
string
(
test
.
fmt
),
test
.
prec
,
"want"
,
test
.
s
,
"got"
,
s
);
}
if
float64
(
float32
(
test
.
f
))
==
test
.
f
&&
test
.
fmt
!=
'b'
{
s
:=
strconv
.
ftoa32
(
float32
(
test
.
f
),
test
.
fmt
,
test
.
prec
);
if
s
!=
test
.
s
{
t
.
Error
f
(
"test32"
,
test
.
f
,
string
(
test
.
fmt
),
test
.
prec
,
"want"
,
test
.
s
,
"got"
,
s
);
t
.
Error
(
"test32"
,
test
.
f
,
string
(
test
.
fmt
),
test
.
prec
,
"want"
,
test
.
s
,
"got"
,
s
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment