summaryrefslogtreecommitdiff
path: root/tcpproxy_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tcpproxy_test.go')
-rw-r--r--tcpproxy_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/tcpproxy_test.go b/tcpproxy_test.go
index 682214d..83729e3 100644
--- a/tcpproxy_test.go
+++ b/tcpproxy_test.go
@@ -72,10 +72,14 @@ func TestMatchHTTPHost(t *testing.T) {
t.Run(name, func(t *testing.T) {
br := bufio.NewReader(tt.r)
r := httpHostMatch{equals(tt.host), noopTarget{}}
- got := r.match(br) != nil
+ m, name := r.match(br)
+ got := m != nil
if got != tt.want {
t.Fatalf("match = %v; want %v", got, tt.want)
}
+ if tt.want && name != tt.host {
+ t.Fatalf("host = %s; want %s", name, tt.host)
+ }
get := make([]byte, 3)
if _, err := io.ReadFull(br, get); err != nil {
t.Fatal(err)