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
1a8bd671
Commit
1a8bd671
authored
Sep 23, 2010
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: fix redirect test for international users
R=r CC=golang-dev
https://golang.org/cl/2197047
parent
855f0835
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
request_test.go
src/pkg/http/request_test.go
+5
-3
No files found.
src/pkg/http/request_test.go
View file @
1a8bd671
...
...
@@ -7,6 +7,7 @@ package http
import
(
"bytes"
"reflect"
"regexp"
"strings"
"testing"
)
...
...
@@ -140,14 +141,15 @@ func TestMultipartReader(t *testing.T) {
func
TestRedirect
(
t
*
testing
.
T
)
{
const
(
start
=
"http://google.com/"
end
=
"http://www.google.com/
"
end
Re
=
"^http://www
\\
.google
\\
.[a-z.]+/$
"
)
var
end
=
regexp
.
MustCompile
(
endRe
)
r
,
url
,
err
:=
Get
(
start
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
r
.
Body
.
Close
()
if
r
.
StatusCode
!=
200
||
url
!=
end
{
t
.
Fatalf
(
"Get(%s) got status %d at %
s, want 200 at %s"
,
start
,
r
.
StatusCode
,
url
,
end
)
if
r
.
StatusCode
!=
200
||
!
end
.
MatchString
(
url
)
{
t
.
Fatalf
(
"Get(%s) got status %d at %
q, want 200 matching %q"
,
start
,
r
.
StatusCode
,
url
,
endRe
)
}
}
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