55 "errors"
66 "io"
77 "os"
8+ "strconv"
89 "testing"
910
1011 "github.com/docker/cli/cli"
7576 {
7677 options : withDefaultOpts (ExecOptions {Detach : true }),
7778 expected : container.ExecOptions {
78- Detach : true ,
79- Cmd : []string {"command" },
79+ Cmd : []string {"command" },
8080 },
8181 },
8282 {
8686 Detach : true ,
8787 }),
8888 expected : container.ExecOptions {
89- Detach : true ,
90- Tty : true ,
91- Cmd : []string {"command" },
89+ Tty : true ,
90+ Cmd : []string {"command" },
9291 },
9392 },
9493 {
9796 expected : container.ExecOptions {
9897 Cmd : []string {"command" },
9998 DetachKeys : "de" ,
100- Detach : true ,
10199 },
102100 },
103101 {
@@ -109,7 +107,6 @@ TWO=2
109107 expected : container.ExecOptions {
110108 Cmd : []string {"command" },
111109 DetachKeys : "ab" ,
112- Detach : true ,
113110 },
114111 },
115112 {
@@ -141,10 +138,12 @@ TWO=2
141138 },
142139 }
143140
144- for _ , testcase := range testcases {
145- execConfig , err := parseExec (testcase .options , & testcase .configFile )
146- assert .NilError (t , err )
147- assert .Check (t , is .DeepEqual (testcase .expected , * execConfig ))
141+ for i , testcase := range testcases {
142+ t .Run ("test " + strconv .Itoa (i + 1 ), func (t * testing.T ) {
143+ execConfig , err := parseExec (testcase .options , & testcase .configFile )
144+ assert .NilError (t , err )
145+ assert .Check (t , is .DeepEqual (testcase .expected , * execConfig ))
146+ })
148147 }
149148}
150149
0 commit comments