mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-14 06:46:27 +03:00
test added
This commit is contained in:
parent
cc34337b8e
commit
3a76cc7b0b
1 changed files with 5 additions and 5 deletions
|
@ -19,19 +19,19 @@ func TestMap(t *testing.T) {
|
||||||
|
|
||||||
map {http.request.method} {dest-1} {dest-2} {
|
map {http.request.method} {dest-1} {dest-2} {
|
||||||
default unknown1 unknown2
|
default unknown1 unknown2
|
||||||
~G.T get-called
|
~G([\w]+) G{http.regexp.1} called
|
||||||
POST post-called foobar
|
POST post-called
|
||||||
}
|
}
|
||||||
|
|
||||||
respond /version 200 {
|
respond /version 200 {
|
||||||
body "hello from localhost {dest-1} {dest-2}"
|
body "hello from localhost {dest-1} {dest-2}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`, "caddyfile")
|
`, "caddyfile")
|
||||||
|
|
||||||
// act and assert
|
// act and assert
|
||||||
tester.AssertGetResponse("http://localhost:9080/version", 200, "hello from localhost get-called unknown2")
|
tester.AssertGetResponse("http://localhost:9080/version", 200, "hello from localhost GET called")
|
||||||
tester.AssertPostResponseBody("http://localhost:9080/version", []string{}, bytes.NewBuffer([]byte{}), 200, "hello from localhost post-called foobar")
|
tester.AssertPostResponseBody("http://localhost:9080/version", []string{}, bytes.NewBuffer([]byte{}), 200, "hello from localhost post-called unknown2")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMapRespondWithDefault(t *testing.T) {
|
func TestMapRespondWithDefault(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue