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
d7db1b95
Commit
d7db1b95
authored
Jun 13, 2015
by
karthic rao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Assertions
Added assertions to check for the extensions in the order specified
parent
2a166f08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
config/setup/ext_test.go
config/setup/ext_test.go
+13
-5
No files found.
config/setup/ext_test.go
View file @
d7db1b95
...
...
@@ -2,8 +2,8 @@ package setup
import
(
"testing"
"github.com/mholt/caddy/middleware/ext"
"github.com/mholt/caddy/middleware/ext
ensions
"
)
func
TestExt
(
t
*
testing
.
T
)
{
...
...
@@ -20,12 +20,20 @@ func TestExt(t *testing.T) {
}
handler
:=
mid
(
emptyNext
)
myHandler
,
ok
:=
handler
.
(
ext
.
Ext
)
myHandler
,
ok
:=
handler
.
(
extensions
.
Ext
)
if
!
ok
{
t
.
Fatalf
(
"Expected handler to be type Ext, got: %#v"
,
handler
)
}
if
!
sameNext
(
myHandler
.
Next
,
emptyNext
)
{
t
.
Error
(
"'Next' field of handler was not set properly"
)
if
myHandler
.
Extensions
[
0
]
!=
".html"
{
t
.
Errorf
(
"Expected .html in the list of Extensions"
)
}
if
myHandler
.
Extensions
[
1
]
!=
".htm"
{
t
.
Errorf
(
"Expected .htm in the list of Extensions"
)
}
if
myHandler
.
Extensions
[
2
]
!=
".php"
{
t
.
Errorf
(
"Expected .php in the list of Extensions"
)
}
}
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