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) { ...@@ -28,16 +28,18 @@ func TestSplitSchemeNamePort(t *testing.T) {
normalized bool normalized bool
}{ }{
{ {
in: "aoeu:asdf", in: "aoeu:asdf",
name: "aoeu", name: "aoeu",
port: "asdf", port: "asdf",
valid: true, valid: true,
normalized: true,
}, { }, {
in: "http:aoeu:asdf", in: "http:aoeu:asdf",
scheme: "http", scheme: "http",
name: "aoeu", name: "aoeu",
port: "asdf", port: "asdf",
valid: true, valid: true,
normalized: true,
}, { }, {
in: "https:aoeu:", in: "https:aoeu:",
scheme: "https", scheme: "https",
...@@ -46,26 +48,34 @@ func TestSplitSchemeNamePort(t *testing.T) { ...@@ -46,26 +48,34 @@ func TestSplitSchemeNamePort(t *testing.T) {
valid: true, valid: true,
normalized: false, normalized: false,
}, { }, {
in: "https:aoeu:asdf", in: "https:aoeu:asdf",
scheme: "https", scheme: "https",
name: "aoeu", name: "aoeu",
port: "asdf", port: "asdf",
valid: true, valid: true,
normalized: true,
}, { }, {
in: "aoeu:", in: "aoeu:",
name: "aoeu", name: "aoeu",
valid: true, valid: true,
normalized: false, normalized: false,
}, { }, {
in: "aoeu",
name: "aoeu",
valid: true,
normalized: true,
}, {
in: ":asdf", in: ":asdf",
valid: false, valid: false,
}, { }, {
in: "aoeu:asdf:htns", in: "aoeu:asdf:htns",
valid: false, valid: false,
}, { }, {
in: "aoeu", in: "http::asdf",
name: "aoeu", valid: false,
valid: true, }, {
in: "http::",
valid: false,
}, { }, {
in: "", in: "",
valid: false, 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