Skip to content

Commit a785392

Browse files
committed
chore: more test cases
1 parent 1220039 commit a785392

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

cli/configssh_test.go

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,35 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
596596
ProvisionApply: echo.ProvisionApplyWithAgent(""),
597597
},
598598
wantConfig: wantConfig{
599-
regexMatch: "--header-command /foo/bar/coder ssh",
599+
regexMatch: "--header-command \"/foo/bar/coder\" ssh",
600+
},
601+
},
602+
{
603+
name: "Header command with double quotes",
604+
args: []string{
605+
"--header-command", "/foo/bar/coder arg1 arg2=\"quoted value\"",
606+
},
607+
wantErr: false,
608+
echoResponse: &echo.Responses{
609+
Parse: echo.ParseComplete,
610+
ProvisionApply: echo.ProvisionApplyWithAgent(""),
611+
},
612+
wantConfig: wantConfig{
613+
regexMatch: "--header-command \"/foo/bar/coder arg1 arg2=\\\"quoted value\\\"\" ssh",
614+
},
615+
},
616+
{
617+
name: "Header command with single quotes",
618+
args: []string{
619+
"--header-command", "/foo/bar/coder arg1 arg2='quoted value'",
620+
},
621+
wantErr: false,
622+
echoResponse: &echo.Responses{
623+
Parse: echo.ParseComplete,
624+
ProvisionApply: echo.ProvisionApplyWithAgent(""),
625+
},
626+
wantConfig: wantConfig{
627+
regexMatch: "--header-command \"/foo/bar/coder arg1 arg2='quoted value'\" ssh",
600628
},
601629
},
602630
}

0 commit comments

Comments
 (0)