From 9b5ad487d7b54e947568da81cd36d81810de21b7 Mon Sep 17 00:00:00 2001 From: Marc Guasch Date: Sat, 4 Jun 2016 01:07:53 +0200 Subject: [PATCH] Add several upstreams test case --- caddy/setup/proxy_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/caddy/setup/proxy_test.go b/caddy/setup/proxy_test.go index 1a1043b2b..3d6d04a09 100644 --- a/caddy/setup/proxy_test.go +++ b/caddy/setup/proxy_test.go @@ -96,6 +96,20 @@ func TestUpstream(t *testing.T) { "http://testendpoint": {}, }, }, + + // test #9 test several upstream directives + { + "proxy / localhost:8080 {\n upstream localhost:8081-8082\n upstream localhost:8083-8085\n}", + false, + map[string]struct{}{ + "http://localhost:8080": {}, + "http://localhost:8081": {}, + "http://localhost:8082": {}, + "http://localhost:8083": {}, + "http://localhost:8084": {}, + "http://localhost:8085": {}, + }, + }, } { receivedFunc, err := Proxy(NewTestController(test.input)) if err != nil && !test.shouldErr {