mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 02:07:58 +00:00
Add vendor folder to git
This commit is contained in:
parent
66cf5eaafb
commit
183585f56f
6916 changed files with 2629581 additions and 1 deletions
30
vendor/github.com/go-openapi/swag/net_test.go
generated
vendored
Normal file
30
vendor/github.com/go-openapi/swag/net_test.go
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package swag
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSplitHostPort(t *testing.T) {
|
||||
data := []struct {
|
||||
Input string
|
||||
Host string
|
||||
Port int
|
||||
Err bool
|
||||
}{
|
||||
{"localhost:3933", "localhost", 3933, false},
|
||||
{"localhost:yellow", "", -1, true},
|
||||
{"localhost", "", -1, true},
|
||||
{"localhost:", "", -1, true},
|
||||
{"localhost:3933", "localhost", 3933, false},
|
||||
}
|
||||
|
||||
for _, e := range data {
|
||||
h, p, err := SplitHostPort(e.Input)
|
||||
if (!e.Err && assert.NoError(t, err)) || (e.Err && assert.Error(t, err)) {
|
||||
assert.Equal(t, e.Host, h)
|
||||
assert.Equal(t, e.Port, p)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue