Commit 367b558f authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #35956 from xiangpengzhao/add-port-split-testcase

Automatic merge from submit-queue (batch tested with PRs 36736, 35956, 35655, 37713, 38316) Optimize port_split_test test case. The `normalized` field doesn't take affect in current test case. This PR: 1. initializes valid and normalized cases with normalized=true. 2. adds some invalid cases. @resouer Thanks!
parents 14ae96ad 466fee86
......@@ -28,16 +28,18 @@ func TestSplitSchemeNamePort(t *testing.T) {
normalized bool
}{
{
in: "aoeu:asdf",
name: "aoeu",
port: "asdf",
valid: true,
in: "aoeu:asdf",
name: "aoeu",
port: "asdf",
valid: true,
normalized: true,
}, {
in: "http:aoeu:asdf",
scheme: "http",
name: "aoeu",
port: "asdf",
valid: true,
in: "http:aoeu:asdf",
scheme: "http",
name: "aoeu",
port: "asdf",
valid: true,
normalized: true,
}, {
in: "https:aoeu:",
scheme: "https",
......@@ -46,26 +48,34 @@ func TestSplitSchemeNamePort(t *testing.T) {
valid: true,
normalized: false,
}, {
in: "https:aoeu:asdf",
scheme: "https",
name: "aoeu",
port: "asdf",
valid: true,
in: "https:aoeu:asdf",
scheme: "https",
name: "aoeu",
port: "asdf",
valid: true,
normalized: true,
}, {
in: "aoeu:",
name: "aoeu",
valid: true,
normalized: false,
}, {
in: "aoeu",
name: "aoeu",
valid: true,
normalized: true,
}, {
in: ":asdf",
valid: false,
}, {
in: "aoeu:asdf:htns",
valid: false,
}, {
in: "aoeu",
name: "aoeu",
valid: true,
in: "http::asdf",
valid: false,
}, {
in: "http::",
valid: false,
}, {
in: "",
valid: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment