Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
8294f0a3
Commit
8294f0a3
authored
Dec 18, 2017
by
keks
Committed by
Jeromy
Jan 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove test for deleted fuction
License: MIT Signed-off-by:
keks
<
keks@cryptoscope.co
>
parent
fbc36b89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
38 deletions
+0
-38
core/corehttp/option_test.go
core/corehttp/option_test.go
+0
-38
No files found.
core/corehttp/option_test.go
View file @
8294f0a3
...
...
@@ -73,41 +73,3 @@ func TestCheckVersionOption(t *testing.T) {
}
}
}
func
TestServerNameOption
(
t
*
testing
.
T
)
{
type
testcase
struct
{
name
string
}
tcs
:=
[]
testcase
{
{
"go-ipfs/0.4.13"
},
{
"go-ipfs/"
+
config
.
CurrentVersionNumber
},
}
assert
:=
func
(
name
string
,
exp
,
got
interface
{})
{
if
got
!=
exp
{
t
.
Errorf
(
"%s: got %q, expected %q"
,
name
,
got
,
exp
)
}
}
for
_
,
tc
:=
range
tcs
{
t
.
Logf
(
"%#v"
,
tc
)
r
:=
httptest
.
NewRequest
(
"POST"
,
"/"
,
nil
)
inner
:=
http
.
NewServeMux
()
inner
.
HandleFunc
(
"/"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
// this block is intentionally left blank.
})
mux
,
err
:=
ServerNameOption
(
tc
.
name
)(
nil
,
nil
,
inner
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
w
:=
httptest
.
NewRecorder
()
mux
.
ServeHTTP
(
w
,
r
)
srvHdr
:=
w
.
Header
()
.
Get
(
"Server"
)
assert
(
"Server header"
,
tc
.
name
,
srvHdr
)
}
}
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