MCPcopy
hub / github.com/spf13/pflag / TestIPSBadQuoting

Function TestIPSBadQuoting

ip_slice_test.go:167–245  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestIPSBadQuoting(t *testing.T) {
168
169 tests := []struct {
170 Want []net.IP
171 FlagArg []string
172 }{
173 {
174 Want: []net.IP{
175 net.ParseIP("a4ab:61d:f03e:5d7d:fad7:d4c2:a1a5:568"),
176 net.ParseIP("203.107.49.208"),
177 net.ParseIP("14.57.204.90"),
178 },
179 FlagArg: []string{
180 "a4ab:61d:f03e:5d7d:fad7:d4c2:a1a5:568",
181 "203.107.49.208",
182 "14.57.204.90",
183 },
184 },
185 {
186 Want: []net.IP{
187 net.ParseIP("204.228.73.195"),
188 net.ParseIP("86.141.15.94"),
189 },
190 FlagArg: []string{
191 "204.228.73.195",
192 "86.141.15.94",
193 },
194 },
195 {
196 Want: []net.IP{
197 net.ParseIP("c70c:db36:3001:890f:c6ea:3f9b:7a39:cc3f"),
198 net.ParseIP("4d17:1d6e:e699:bd7a:88c5:5e7e:ac6a:4472"),
199 },
200 FlagArg: []string{
201 "c70c:db36:3001:890f:c6ea:3f9b:7a39:cc3f",
202 "4d17:1d6e:e699:bd7a:88c5:5e7e:ac6a:4472",
203 },
204 },
205 {
206 Want: []net.IP{
207 net.ParseIP("5170:f971:cfac:7be3:512a:af37:952c:bc33"),
208 net.ParseIP("93.21.145.140"),
209 net.ParseIP("2cac:61d3:c5ff:6caf:73e0:1b1a:c336:c1ca"),
210 },
211 FlagArg: []string{
212 " 5170:f971:cfac:7be3:512a:af37:952c:bc33 , 93.21.145.140 ",
213 "2cac:61d3:c5ff:6caf:73e0:1b1a:c336:c1ca",
214 },
215 },
216 {
217 Want: []net.IP{
218 net.ParseIP("2e5e:66b2:6441:848:5b74:76ea:574c:3a7b"),
219 net.ParseIP("2e5e:66b2:6441:848:5b74:76ea:574c:3a7b"),
220 net.ParseIP("2e5e:66b2:6441:848:5b74:76ea:574c:3a7b"),
221 net.ParseIP("2e5e:66b2:6441:848:5b74:76ea:574c:3a7b"),
222 },
223 FlagArg: []string{
224 `"2e5e:66b2:6441:848:5b74:76ea:574c:3a7b, 2e5e:66b2:6441:848:5b74:76ea:574c:3a7b,2e5e:66b2:6441:848:5b74:76ea:574c:3a7b "`,

Callers

nothing calls this directly

Calls 2

setUpIPSFlagSetFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected