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

Function TestPrivateIPQueryParams

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

Source from the content-addressed store, hash-verified

942}
943
944func TestPrivateIPQueryParams(t *testing.T) {
945 tcs := []struct {
946 desc string
947 args []string
948 want *bool
949 }{
950 {
951 desc: "when the query string is absent",
952 args: []string{"proj:region:inst"},
953 want: nil,
954 },
955 {
956 desc: "when the query string has no value",
957 args: []string{"proj:region:inst?private-ip"},
958 want: pointer(true),
959 },
960 {
961 desc: "when the query string is true",
962 args: []string{"proj:region:inst?private-ip=true"},
963 want: pointer(true),
964 },
965 {
966 desc: "when the query string is True",
967 args: []string{"proj:region:inst?private-ip=True"},
968 want: pointer(true),
969 },
970 {
971 desc: "when the query string is (short) T",
972 args: []string{"proj:region:inst?private-ip=T"},
973 want: pointer(true),
974 },
975 {
976 desc: "when the query string is (short) t",
977 args: []string{"proj:region:inst?private-ip=t"},
978 want: pointer(true),
979 },
980 {
981 desc: "when the query string is false",
982 args: []string{"proj:region:inst?private-ip=false"},
983 want: pointer(false),
984 },
985 {
986 desc: "when the query string is (short) f",
987 args: []string{"proj:region:inst?private-ip=f"},
988 want: pointer(false),
989 },
990 {
991 desc: "when the query string is False",
992 args: []string{"proj:region:inst?private-ip=False"},
993 want: pointer(false),
994 },
995 {
996 desc: "when the query string is (short) F",
997 args: []string{"proj:region:inst?private-ip=F"},
998 want: pointer(false),
999 },
1000 }
1001 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