Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
  • Loading branch information
jacobweinstock committed Nov 11, 2021
1 parent 93ab41a commit 4c0cf94
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions proxy/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"net/url"
"reflect"
"testing"

"github.com/go-logr/logr"
Expand Down Expand Up @@ -87,3 +88,30 @@ func TestNewHandler(t *testing.T) {
})
}
}

func TestValidateURL(t *testing.T) {
v := reflect.ValueOf(1)
if r := validateURL(v); r != nil {
t.Fatal(r)
}
v = reflect.ValueOf(url.URL{
Host: "\x00",
})
if r := validateURL(v); r != nil {
t.Fatal(r)
}
}

func TestValidateIPPORT(t *testing.T) {
v := reflect.ValueOf(1)
if r := validateIPPORT(v); r != nil {
t.Fatal(r)
}
}

func TestValidateLogr(t *testing.T) {
v := reflect.ValueOf(1)
if r := validateLogr(v); r != nil {
t.Fatal(r)
}
}

0 comments on commit 4c0cf94

Please sign in to comment.