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
a4bf6e58
Commit
a4bf6e58
authored
Jun 29, 2017
by
Tw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
markdown: fix the real ineffectual assignments in test
Signed-off-by:
Tw
<
tw19881113@gmail.com
>
parent
dfa389c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
caddyhttp/markdown/markdown_test.go
caddyhttp/markdown/markdown_test.go
+4
-5
No files found.
caddyhttp/markdown/markdown_test.go
View file @
a4bf6e58
...
...
@@ -81,17 +81,14 @@ func TestMarkdown(t *testing.T) {
req
,
err
:=
http
.
NewRequest
(
"GET"
,
url
,
nil
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not create HTTP request: %v"
,
err
)
return
""
}
rec
:=
httptest
.
NewRecorder
()
code
,
err
:=
md
.
ServeHTTP
(
rec
,
req
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
return
""
}
if
code
!=
http
.
StatusOK
{
t
.
Fatalf
(
"Wrong status, expected: %d and got %d"
,
http
.
StatusOK
,
code
)
return
""
}
return
rec
.
Body
.
String
()
}
...
...
@@ -117,6 +114,10 @@ Welcome to A Caddy website!
</body>
</html>
`
if
respBody
!=
expectedBody
{
t
.
Fatalf
(
"Expected body:
\n
%q
\n
got:
\n
%q"
,
expectedBody
,
respBody
)
}
respBody
=
get
(
"/docflags/test.md"
)
expectedBody
=
`Doc.var_string hello
Doc.var_bool true
...
...
@@ -226,11 +227,9 @@ func TestTemplateReload(t *testing.T) {
code
,
err
:=
md
.
ServeHTTP
(
rec
,
req
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
return
""
}
if
code
!=
http
.
StatusOK
{
t
.
Fatalf
(
"Wrong status, expected: %d and got %d"
,
http
.
StatusOK
,
code
)
return
""
}
return
rec
.
Body
.
String
()
}
...
...
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