MCPcopy Index your code
hub / github.com/coder/coder / TestSSHConfig_ParseOptions

Function TestSSHConfig_ParseOptions

codersdk/deployment_test.go:416–492  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

414}
415
416func 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,

Callers

nothing calls this directly

Calls 4

ParseOptionsMethod · 0.95
RunMethod · 0.65
ErrorMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected