Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
850ad9a4
Commit
850ad9a4
authored
Feb 01, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strconv: add test that trips up other implementations
R=r, gri1 CC=golang-dev
https://golang.org/cl/4092045
parent
59a47732
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
src/pkg/strconv/atof_test.go
src/pkg/strconv/atof_test.go
+5
-0
src/pkg/strconv/ftoa_test.go
src/pkg/strconv/ftoa_test.go
+6
-0
No files found.
src/pkg/strconv/atof_test.go
View file @
850ad9a4
...
...
@@ -103,6 +103,11 @@ var atoftests = []atofTest{
{
"1e"
,
"0"
,
os
.
EINVAL
},
{
"1e-"
,
"0"
,
os
.
EINVAL
},
{
".e-1"
,
"0"
,
os
.
EINVAL
},
// http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
{
"2.2250738585072012e-308"
,
"2.2250738585072014e-308"
,
nil
},
// http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
{
"2.2250738585072011e-308"
,
"2.225073858507201e-308"
,
nil
},
}
func
init
()
{
...
...
src/pkg/strconv/ftoa_test.go
View file @
850ad9a4
...
...
@@ -118,6 +118,12 @@ var ftoatests = []ftoaTest{
{
0.5
,
'f'
,
1
,
"0.5"
},
{
0.5
,
'f'
,
0
,
"0"
},
{
1.5
,
'f'
,
0
,
"2"
},
// http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
{
2.2250738585072012e-308
,
'g'
,
-
1
,
"2.2250738585072014e-308"
},
// TODO: uncomment after fixing issue 1463.
// http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
// {2.2250738585072011e-308, 'g', -1, "2.225073858507201e-308"},
}
func
TestFtoa
(
t
*
testing
.
T
)
{
...
...
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