Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
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
nexedi
caddy
Commits
59e6ceb5
Commit
59e6ceb5
authored
Jan 23, 2017
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor test cleanup
parent
82929b12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
caddy_test.go
caddy_test.go
+4
-6
No files found.
caddy_test.go
View file @
59e6ceb5
...
@@ -67,7 +67,6 @@ func TestListenerAddrEqual(t *testing.T) {
...
@@ -67,7 +67,6 @@ func TestListenerAddrEqual(t *testing.T) {
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
defer
ln1
.
Close
()
defer
ln1
.
Close
()
ln1port
:=
strconv
.
Itoa
(
ln1
.
Addr
()
.
(
*
net
.
TCPAddr
)
.
Port
)
ln1port
:=
strconv
.
Itoa
(
ln1
.
Addr
()
.
(
*
net
.
TCPAddr
)
.
Port
)
ln2
,
err
:=
net
.
Listen
(
"tcp"
,
"127.0.0.1:0"
)
ln2
,
err
:=
net
.
Listen
(
"tcp"
,
"127.0.0.1:0"
)
...
@@ -75,7 +74,6 @@ func TestListenerAddrEqual(t *testing.T) {
...
@@ -75,7 +74,6 @@ func TestListenerAddrEqual(t *testing.T) {
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
defer
ln2
.
Close
()
defer
ln2
.
Close
()
ln2port
:=
strconv
.
Itoa
(
ln2
.
Addr
()
.
(
*
net
.
TCPAddr
)
.
Port
)
ln2port
:=
strconv
.
Itoa
(
ln2
.
Addr
()
.
(
*
net
.
TCPAddr
)
.
Port
)
for
i
,
test
:=
range
[]
struct
{
for
i
,
test
:=
range
[]
struct
{
...
@@ -86,12 +84,12 @@ func TestListenerAddrEqual(t *testing.T) {
...
@@ -86,12 +84,12 @@ func TestListenerAddrEqual(t *testing.T) {
{
ln1
,
":1234"
,
false
},
{
ln1
,
":1234"
,
false
},
{
ln1
,
"0.0.0.0:1234"
,
false
},
{
ln1
,
"0.0.0.0:1234"
,
false
},
{
ln1
,
"0.0.0.0"
,
false
},
{
ln1
,
"0.0.0.0"
,
false
},
{
ln1
,
":"
+
ln1port
+
""
,
true
},
{
ln1
,
":"
+
ln1port
,
true
},
{
ln1
,
"0.0.0.0:"
+
ln1port
+
""
,
true
},
{
ln1
,
"0.0.0.0:"
+
ln1port
,
true
},
{
ln2
,
":"
+
ln2port
+
""
,
false
},
{
ln2
,
":"
+
ln2port
,
false
},
{
ln2
,
"127.0.0.1:1234"
,
false
},
{
ln2
,
"127.0.0.1:1234"
,
false
},
{
ln2
,
"127.0.0.1"
,
false
},
{
ln2
,
"127.0.0.1"
,
false
},
{
ln2
,
"127.0.0.1:"
+
ln2port
+
""
,
true
},
{
ln2
,
"127.0.0.1:"
+
ln2port
,
true
},
}
{
}
{
if
got
,
want
:=
listenerAddrEqual
(
test
.
ln
,
test
.
addr
),
test
.
expect
;
got
!=
want
{
if
got
,
want
:=
listenerAddrEqual
(
test
.
ln
,
test
.
addr
),
test
.
expect
;
got
!=
want
{
t
.
Errorf
(
"Test %d (%s == %s): expected %v but was %v"
,
i
,
test
.
addr
,
test
.
ln
.
Addr
()
.
String
(),
want
,
got
)
t
.
Errorf
(
"Test %d (%s == %s): expected %v but was %v"
,
i
,
test
.
addr
,
test
.
ln
.
Addr
()
.
String
(),
want
,
got
)
...
...
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