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
679668e3
Commit
679668e3
authored
Aug 30, 2015
by
Karthic Rao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed redundant comment lines
parent
73026974
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
config/setup/fastcgi_test.go
config/setup/fastcgi_test.go
+10
-0
middleware/browse/browse_test.go
middleware/browse/browse_test.go
+2
-4
No files found.
config/setup/fastcgi_test.go
View file @
679668e3
...
@@ -51,6 +51,16 @@ func TestFastcgiParse(t *testing.T) {
...
@@ -51,6 +51,16 @@ func TestFastcgiParse(t *testing.T) {
SplitPath
:
".php"
,
SplitPath
:
".php"
,
IndexFiles
:
[]
string
{
"index.php"
},
IndexFiles
:
[]
string
{
"index.php"
},
}}},
}}},
{
`fastcgi / 127.0.0.1:9001 {
split .html
}`
,
false
,
[]
fastcgi
.
Rule
{{
Path
:
"/"
,
Address
:
"127.0.0.1:9001"
,
Ext
:
""
,
SplitPath
:
".html"
,
IndexFiles
:
[]
string
{},
}}},
}
}
for
i
,
test
:=
range
tests
{
for
i
,
test
:=
range
tests
{
c
:=
NewTestController
(
test
.
inputFastcgiConfig
)
c
:=
NewTestController
(
test
.
inputFastcgiConfig
)
...
...
middleware/browse/browse_test.go
View file @
679668e3
package
browse
package
browse
import
(
import
(
//"bytes"
"encoding/json"
"encoding/json"
"github.com/mholt/caddy/middleware"
"github.com/mholt/caddy/middleware"
"net/http"
"net/http"
...
@@ -191,7 +190,7 @@ func TestBrowseJson(t *testing.T) {
...
@@ -191,7 +190,7 @@ func TestBrowseJson(t *testing.T) {
}
}
actualJsonResponseString
:=
rec
.
Body
.
String
()
actualJsonResponseString
:=
rec
.
Body
.
String
()
//t.Logf("json response body: %s\n", respBody)
//generating the listing to compare it with the response body
//generating the listing to compare it with the response body
file
,
err
:=
os
.
Open
(
b
.
Root
+
req
.
URL
.
Path
)
file
,
err
:=
os
.
Open
(
b
.
Root
+
req
.
URL
.
Path
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -233,12 +232,11 @@ func TestBrowseJson(t *testing.T) {
...
@@ -233,12 +232,11 @@ func TestBrowseJson(t *testing.T) {
listing
.
Order
=
"asc"
listing
.
Order
=
"asc"
listing
.
applySort
()
listing
.
applySort
()
//var buf bytes.Buffer
marsh
,
err
:=
json
.
Marshal
(
listing
.
Items
)
marsh
,
err
:=
json
.
Marshal
(
listing
.
Items
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Unable to Marshal the listing "
)
t
.
Fatalf
(
"Unable to Marshal the listing "
)
}
}
//t.Logf("json value: %s\n", string(marsh))
expectedJsonString
:=
string
(
marsh
)
expectedJsonString
:=
string
(
marsh
)
if
actualJsonResponseString
!=
expectedJsonString
{
if
actualJsonResponseString
!=
expectedJsonString
{
t
.
Errorf
(
"Json response string doesnt match the expected Json response "
)
t
.
Errorf
(
"Json response string doesnt match the expected Json response "
)
...
...
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