Commit ac20325
committed
Test version_info parsing
This modifies two existing test cases to include an assertion about
the length. These test cases are retained as there is value in
testing on output from a real git command rather than only with
test doubles.
More importantly, this also adds a parameterized test method to
check parsing of:
- All numeric, shorter than the limit - all fields used.
- All numeric, at the limit - all fields used.
- All numeric, longer than the limit - extra fields dropped.
- Has unambiguous non-numeric - dropped from there on.
- Has ambiguous non-numeric, negative int - dropped from there on.
- Has ambiguous non-numeric, number+letter - dropped from there on.
The cases for parsing when a field is not numeric (or not fully or
unambiguously numeric) currently all fail, because the existing
logic drops intermediate non-numeric fields (gitpython-developers#1833).
Parsing should instead stop at (or, *perhaps* in cases like "2a",
after) such fields. When the code is changed to stop at them
rather than dropping them and presenting the subsequent field as
though it were a previous field, these test cases should also pass.1 parent dc6b90f commit ac20325
1 file changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| |||
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
| 353 | + | |
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
355 | 373 | | |
356 | 374 | | |
357 | 375 | | |
| |||
0 commit comments