@@ -610,11 +610,11 @@ func TestApp(t *testing.T) {
610610 }{
611611 {
612612 name : "Command" ,
613- command : "read -p \" Workspace spawned. Press enter to continue...\" " ,
613+ command : "read -p \\ \ " Workspace spawned. Press enter to continue...\\ \" " ,
614614 },
615615 {
616616 name : "CommandAndURL" ,
617- command : "read -p \" Workspace spawned. Press enter to continue...\" " ,
617+ command : "read -p \\ \ " Workspace spawned. Press enter to continue...\\ \" " ,
618618 subdomain : true ,
619619 expectError : regexp .MustCompile ("conflicts with subdomain" ),
620620 },
@@ -625,6 +625,36 @@ func TestApp(t *testing.T) {
625625
626626 t .Run (c .name , func (t * testing.T ) {
627627 t .Parallel ()
628+
629+ subdomainLine := ""
630+ if c .subdomain {
631+ subdomainLine = "subdomain = true"
632+ }
633+
634+ config := fmt .Sprintf (`
635+ provider "coder" {}
636+ resource "coder_agent" "dev" {
637+ os = "linux"
638+ arch = "amd64"
639+ }
640+ resource "coder_app" "code-server" {
641+ agent_id = coder_agent.dev.id
642+ slug = "code-server"
643+ display_name = "Testing"
644+ open_in = "slim-window"
645+ command = "%s"
646+ %s
647+ }
648+ ` , c .command , subdomainLine )
649+
650+ resource .Test (t , resource.TestCase {
651+ ProviderFactories : coderFactory (),
652+ IsUnitTest : true ,
653+ Steps : []resource.TestStep {{
654+ Config : config ,
655+ ExpectError : c .expectError ,
656+ }},
657+ })
628658 })
629659 }
630660 })
0 commit comments