(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestParseRunAttach(t *testing.T) { |
| 158 | tests := []struct { |
| 159 | input string |
| 160 | expected container.Config |
| 161 | }{ |
| 162 | { |
| 163 | input: "", |
| 164 | expected: container.Config{ |
| 165 | AttachStdout: true, |
| 166 | AttachStderr: true, |
| 167 | }, |
| 168 | }, |
| 169 | { |
| 170 | input: "-i", |
| 171 | expected: container.Config{ |
| 172 | AttachStdin: true, |
| 173 | AttachStdout: true, |
| 174 | AttachStderr: true, |
| 175 | }, |
| 176 | }, |
| 177 | { |
| 178 | input: "-a stdin", |
| 179 | expected: container.Config{ |
| 180 | AttachStdin: true, |
| 181 | }, |
| 182 | }, |
| 183 | { |
| 184 | input: "-a stdin -a stdout", |
| 185 | expected: container.Config{ |
| 186 | AttachStdin: true, |
| 187 | AttachStdout: true, |
| 188 | }, |
| 189 | }, |
| 190 | { |
| 191 | input: "-a stdin -a stdout -a stderr", |
| 192 | expected: container.Config{ |
| 193 | AttachStdin: true, |
| 194 | AttachStdout: true, |
| 195 | AttachStderr: true, |
| 196 | }, |
| 197 | }, |
| 198 | } |
| 199 | for _, tc := range tests { |
| 200 | t.Run(tc.input, func(t *testing.T) { |
| 201 | config, _, _ := mustParse(t, tc.input) |
| 202 | assert.Equal(t, config.AttachStdin, tc.expected.AttachStdin) |
| 203 | assert.Equal(t, config.AttachStdout, tc.expected.AttachStdout) |
| 204 | assert.Equal(t, config.AttachStderr, tc.expected.AttachStderr) |
| 205 | }) |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func TestParseRunWithInvalidArgs(t *testing.T) { |
| 210 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…