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
f7e3ed13
Commit
f7e3ed13
authored
Oct 15, 2015
by
Makpoc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestInclude 2 should fail. Update test data and fix error checking
parent
71c4962f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
middleware/context_test.go
middleware/context_test.go
+4
-1
No files found.
middleware/context_test.go
View file @
f7e3ed13
...
...
@@ -46,7 +46,7 @@ func TestInclude(t *testing.T) {
{
fileContent
:
`str1 {{ .InvalidField }} str2`
,
expectedContent
:
""
,
shouldErr
:
fals
e
,
shouldErr
:
tru
e
,
expectedErrorContent
:
`InvalidField is not a field of struct type middleware.Context`
,
},
}
...
...
@@ -62,6 +62,9 @@ func TestInclude(t *testing.T) {
content
,
err
:=
context
.
Include
(
inputFilename
)
if
err
!=
nil
{
if
!
test
.
shouldErr
{
t
.
Errorf
(
testPrefix
+
"Expected no error, found [%s]"
,
test
.
expectedErrorContent
,
err
.
Error
())
}
if
!
strings
.
Contains
(
err
.
Error
(),
test
.
expectedErrorContent
)
{
t
.
Errorf
(
testPrefix
+
"Expected error content [%s], found [%s]"
,
test
.
expectedErrorContent
,
err
.
Error
())
}
...
...
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