Skip to content

Commit

Permalink
review: add regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomMoulard committed Jul 6, 2022
1 parent 687c58b commit 26783fc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/muxer/tcp/mux_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tcp

import (
"fmt"
"net"
"testing"
"time"
Expand Down Expand Up @@ -438,11 +439,23 @@ func Test_addTCPRoute(t *testing.T) {
serverName: "bar",
remoteAddr: "10.0.0.1:80",
},
{
desc: "Invalid ALPN rule matching ACME-TLS/1",
rule: fmt.Sprintf("ALPN(`%s`)", tlsalpn01.ACMETLS1Protocol),
protos: []string{"foo"},
routeErr: true,
},
{
desc: "Valid ALPN rule matching single protocol",
rule: "ALPN(`foo`)",
protos: []string{"foo"},
},
{
desc: "Valid ALPN rule matching ACME-TLS/1 protocol",
rule: "ALPN(`foo`)",
protos: []string{tlsalpn01.ACMETLS1Protocol},
matchErr: true,
},
{
desc: "Valid ALPN rule not matching single protocol",
rule: "ALPN(`foo`)",
Expand Down

0 comments on commit 26783fc

Please sign in to comment.