Repository navigation
Commit 3427e71
committed
fix: the path tests read the same on Linux as on Windows
Seven tests failed on the CI's Linux runner and passed here, and the difference was `std::path`'s *host* semantics leaking
into what the tests assert.
**`normalize_path` is now a text splitter rather than a `std::path` walk.** `Path::components()` reads `C:` as a prefix
and `\` as a separator only on Windows, so on Linux `C:\work\src\main.cpp` was one opaque component and every assertion
about it failed. The spelling is what this function exists to normalize — a compiler's output, which may have been
produced on another machine — so the prefix (`C:`, `\\server\share`) is recognized in the text, both separators split,
and the answer is the same everywhere. The doc comment already said "a Windows path has a prefix component that is not a
directory"; that rule just stopped depending on the host.
**The alignment tests take their expected spelling from one helper**, which folds case on Windows only — two files that
differ in case are one file there and two here. Three tests had `c:/…` written out, which is the Windows answer.
**The `PATH`-order test moved its fixture off the conventional install roots** (`/usr/bin`, `/usr/local/bin`, …). A
compiler found there is step 3's answer, and on Linux the fixture in `/usr/bin` was found before `PATH` was consulted at
all — while Windows looked for `/usr/bin/clang++.exe`, found nothing, and reached the `PATH` step this test is about.
The fixture lives in `/p/bin` now, so the test says what it means on both platforms.
Still platform-specific, and deliberately: the case-folding flag itself (a caller's fact, passed in), and the fixtures
that quote a MinGW compiler's output — those are strings, not paths.1 parent 8e85673 commit 3427e71
3 files changed
Lines changed: 94 additions & 56 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1441 | 1441 | | |
1442 | 1442 | | |
1443 | 1443 | | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
1444 | 1455 | | |
1445 | 1456 | | |
1446 | 1457 | | |
| |||
1803 | 1814 | | |
1804 | 1815 | | |
1805 | 1816 | | |
1806 | | - | |
| 1817 | + | |
1807 | 1818 | | |
1808 | 1819 | | |
1809 | | - | |
| 1820 | + | |
1810 | 1821 | | |
1811 | 1822 | | |
1812 | 1823 | | |
1813 | 1824 | | |
1814 | | - | |
| 1825 | + | |
1815 | 1826 | | |
1816 | 1827 | | |
1817 | 1828 | | |
| |||
1829 | 1840 | | |
1830 | 1841 | | |
1831 | 1842 | | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
1838 | 1848 | | |
1839 | 1849 | | |
1840 | 1850 | | |
| |||
1855 | 1865 | | |
1856 | 1866 | | |
1857 | 1867 | | |
1858 | | - | |
| 1868 | + | |
1859 | 1869 | | |
1860 | 1870 | | |
1861 | 1871 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
491 | 490 | | |
| 491 | + | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
493 | 497 | | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
521 | 535 | | |
522 | | - | |
523 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
524 | 539 | | |
525 | 540 | | |
526 | 541 | | |
| |||
541 | 556 | | |
542 | 557 | | |
543 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
544 | 566 | | |
545 | 567 | | |
546 | 568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
401 | 407 | | |
402 | 408 | | |
403 | | - | |
404 | | - | |
405 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
406 | 412 | | |
407 | 413 | | |
408 | | - | |
| 414 | + | |
409 | 415 | | |
410 | 416 | | |
411 | 417 | | |
| |||
0 commit comments