Commit ac64af7
committed
fix(lftest): accept --test args with fewer than three elements
The `test()` helper previously required callers to pass a three-element
CSV (`stdout,stderr,retc`). Plugins that only need to inject STDOUT had
to trail `,,0` on every invocation, and typing `--test=path/to/fixture`
from the command line tripped an `IndexError` on `args[1]`.
Fall back to `''` for stderr and `0` for retc when those positions are
absent, so both `--test=stdout/foo` and `--test=stdout/foo,,0` work
interchangeably.1 parent 930351a commit ac64af7
2 files changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
198 | | - | |
199 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
| |||
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
208 | | - | |
| 213 | + | |
209 | 214 | | |
| 215 | + | |
| 216 | + | |
210 | 217 | | |
211 | | - | |
212 | | - | |
| 218 | + | |
| 219 | + | |
213 | 220 | | |
214 | 221 | | |
215 | 222 | | |
| |||
0 commit comments