Repository navigation
Commit ccf4cba
committed
fix: trim a floatstring range element and unsign a zero
Two review findings, both cases where the forwarded text did not match what
openjd-rs renders for the same element.
float() ignores surrounding whitespace but the regex does not, so ' 1.5 ' was
forwarded with its spaces and reached a command line as --frame ' 1.5 '.
openjd-rs trims the resolved element before keeping it; do the same here.
Zero has no sign. '-0.0' rendered -0.0 here and 0.0 on mainline and in openjd-rs,
which is the reading the deleted test pinned by name. Drop the sign without
dropping the decimal places, so '-0.00' renders 0.00. Text that reaches zero only
by underflow, like '1e-400', does not render the value and is not kept -- which
also covers the huge negative exponents, since '1e-999999999' underflows to zero.
Both now agree with openjd-rs#354 on every case measured: ' 1.5 '->1.5,
'-0.0'->0.0, '-0.00'->0.00, '1e-400'->0.0, '5.'->5., '.5'->.5, '+2.50'->+2.50,
'1E+2'->1E+2.
Also soften a test comment that claimed an element can no longer exceed
TaskParameterStringValueAsJob's cap and fall through to a numeric member of the
union. That holds for the huge-exponent inputs the test parametrizes, but long
literal text still can, on this branch and on mainline and 0.11.6 alike -- only
the expansion is gone.
Verification. Model suite 5533 passed, 24 skipped, 3 xfailed; ruff, black and
mypy clean. Full 2023-09 conformance 1162 passed, 0 failed.
Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>1 parent 51990e9 commit ccf4cba
2 files changed
Lines changed: 39 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | | - | |
| 1265 | + | |
1266 | 1266 | | |
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
1270 | | - | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1271 | 1280 | | |
1272 | 1281 | | |
1273 | 1282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
488 | 498 | | |
489 | 499 | | |
490 | 500 | | |
| |||
508 | 518 | | |
509 | 519 | | |
510 | 520 | | |
511 | | - | |
| 521 | + | |
512 | 522 | | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
517 | 531 | | |
518 | 532 | | |
519 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
520 | 536 | | |
521 | 537 | | |
522 | 538 | | |
523 | 539 | | |
524 | 540 | | |
525 | 541 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
530 | 548 | | |
531 | 549 | | |
532 | 550 | | |
| |||
0 commit comments