1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

test added

This commit is contained in:
Rajat Jain 2021-01-29 01:23:49 +05:30
parent cc34337b8e
commit 3a76cc7b0b

View file

@ -19,8 +19,8 @@ func TestMap(t *testing.T) {
map {http.request.method} {dest-1} {dest-2} {
default unknown1 unknown2
~G.T get-called
POST post-called foobar
~G([\w]+) G{http.regexp.1} called
POST post-called
}
respond /version 200 {
@ -30,8 +30,8 @@ func TestMap(t *testing.T) {
`, "caddyfile")
// act and assert
tester.AssertGetResponse("http://localhost:9080/version", 200, "hello from localhost get-called unknown2")
tester.AssertPostResponseBody("http://localhost:9080/version", []string{}, bytes.NewBuffer([]byte{}), 200, "hello from localhost post-called foobar")
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 unknown2")
}
func TestMapRespondWithDefault(t *testing.T) {