mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
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!
This commit is contained in:
commit
367b558f88
@ -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,16 +48,22 @@ 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,
|
||||
@ -63,9 +71,11 @@ func TestSplitSchemeNamePort(t *testing.T) {
|
||||
in: "aoeu:asdf:htns",
|
||||
valid: false,
|
||||
}, {
|
||||
in: "aoeu",
|
||||
name: "aoeu",
|
||||
valid: true,
|
||||
in: "http::asdf",
|
||||
valid: false,
|
||||
}, {
|
||||
in: "http::",
|
||||
valid: false,
|
||||
}, {
|
||||
in: "",
|
||||
valid: false,
|
||||
|
Loading…
Reference in New Issue
Block a user