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
5b779284
Commit
5b779284
authored
May 26, 2010
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt: fix 386 build. error strings differ for overflow on 386.
R=gri CC=golang-dev
https://golang.org/cl/1316042
parent
71f130f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
scan_test.go
src/pkg/fmt/scan_test.go
+3
-1
No files found.
src/pkg/fmt/scan_test.go
View file @
5b779284
...
@@ -121,6 +121,8 @@ func TestScanln(t *testing.T) {
...
@@ -121,6 +121,8 @@ func TestScanln(t *testing.T) {
}
}
func
TestScanOverflow
(
t
*
testing
.
T
)
{
func
TestScanOverflow
(
t
*
testing
.
T
)
{
// different machines and different types report errors with different strings.
re
:=
testing
.
MustCompile
(
"overflow|too large|out of range|not representable"
)
for
_
,
test
:=
range
overflowTests
{
for
_
,
test
:=
range
overflowTests
{
r
:=
strings
.
NewReader
(
test
.
text
)
r
:=
strings
.
NewReader
(
test
.
text
)
_
,
err
:=
Scan
(
r
,
test
.
in
)
_
,
err
:=
Scan
(
r
,
test
.
in
)
...
@@ -128,7 +130,7 @@ func TestScanOverflow(t *testing.T) {
...
@@ -128,7 +130,7 @@ func TestScanOverflow(t *testing.T) {
t
.
Errorf
(
"expected overflow scanning %q"
,
test
.
text
)
t
.
Errorf
(
"expected overflow scanning %q"
,
test
.
text
)
continue
continue
}
}
if
strings
.
Index
(
err
.
String
(),
"overflow"
)
<
0
&&
strings
.
Index
(
err
.
String
(),
"too large"
)
<
0
{
if
!
re
.
MatchString
(
err
.
String
())
{
t
.
Errorf
(
"expected overflow error scanning %q: %s"
,
test
.
text
,
err
)
t
.
Errorf
(
"expected overflow error scanning %q: %s"
,
test
.
text
,
err
)
}
}
}
}
...
...
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