(t *testing.T)
| 414 | } |
| 415 | |
| 416 | func TestSSHConfig_ParseOptions(t *testing.T) { |
| 417 | t.Parallel() |
| 418 | |
| 419 | testCases := []struct { |
| 420 | Name string |
| 421 | ConfigOptions serpent.StringArray |
| 422 | ExpectError bool |
| 423 | Expect map[string]string |
| 424 | }{ |
| 425 | { |
| 426 | Name: "Empty", |
| 427 | ConfigOptions: []string{}, |
| 428 | Expect: map[string]string{}, |
| 429 | }, |
| 430 | { |
| 431 | Name: "Whitespace", |
| 432 | ConfigOptions: []string{ |
| 433 | "test value", |
| 434 | }, |
| 435 | Expect: map[string]string{ |
| 436 | "test": "value", |
| 437 | }, |
| 438 | }, |
| 439 | { |
| 440 | Name: "SimpleValueEqual", |
| 441 | ConfigOptions: []string{ |
| 442 | "test=value", |
| 443 | }, |
| 444 | Expect: map[string]string{ |
| 445 | "test": "value", |
| 446 | }, |
| 447 | }, |
| 448 | { |
| 449 | Name: "SimpleValues", |
| 450 | ConfigOptions: []string{ |
| 451 | "test=value", |
| 452 | "foo=bar", |
| 453 | }, |
| 454 | Expect: map[string]string{ |
| 455 | "test": "value", |
| 456 | "foo": "bar", |
| 457 | }, |
| 458 | }, |
| 459 | { |
| 460 | Name: "ValueWithQuote", |
| 461 | ConfigOptions: []string{ |
| 462 | "bar=buzz=bazz", |
| 463 | }, |
| 464 | Expect: map[string]string{ |
| 465 | "bar": "buzz=bazz", |
| 466 | }, |
| 467 | }, |
| 468 | { |
| 469 | Name: "NoEquals", |
| 470 | ConfigOptions: []string{ |
| 471 | "foobar", |
| 472 | }, |
| 473 | ExpectError: true, |
nothing calls this directly
no test coverage detected