MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / TestPSCQueryParams

Function TestPSCQueryParams

cmd/root_test.go:1017–1088  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1015}
1016
1017func TestPSCQueryParams(t *testing.T) {
1018 tcs := []struct {
1019 desc string
1020 args []string
1021 want *bool
1022 }{
1023 {
1024 desc: "when the query string is absent",
1025 args: []string{"proj:region:inst"},
1026 want: nil,
1027 },
1028 {
1029 desc: "when the query string has no value",
1030 args: []string{"proj:region:inst?psc"},
1031 want: pointer(true),
1032 },
1033 {
1034 desc: "when the query string is true",
1035 args: []string{"proj:region:inst?psc=true"},
1036 want: pointer(true),
1037 },
1038 {
1039 desc: "when the query string is True",
1040 args: []string{"proj:region:inst?psc=True"},
1041 want: pointer(true),
1042 },
1043 {
1044 desc: "when the query string is (short) T",
1045 args: []string{"proj:region:inst?psc=T"},
1046 want: pointer(true),
1047 },
1048 {
1049 desc: "when the query string is (short) t",
1050 args: []string{"proj:region:inst?psc=t"},
1051 want: pointer(true),
1052 },
1053 {
1054 desc: "when the query string is false",
1055 args: []string{"proj:region:inst?psc=false"},
1056 want: pointer(false),
1057 },
1058 {
1059 desc: "when the query string is (short) f",
1060 args: []string{"proj:region:inst?psc=f"},
1061 want: pointer(false),
1062 },
1063 {
1064 desc: "when the query string is False",
1065 args: []string{"proj:region:inst?psc=False"},
1066 want: pointer(false),
1067 },
1068 {
1069 desc: "when the query string is (short) F",
1070 args: []string{"proj:region:inst?psc=F"},
1071 want: pointer(false),
1072 },
1073 }
1074 for _, tc := range tcs {

Callers

nothing calls this directly

Calls 3

invokeProxyCommandFunction · 0.85
pointerFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected