test_cp.rs: fix error message of ficlone on musl - #14273
Conversation
|
Binary size comparison: |
|
GNU testsuite comparison: |
| .fails() | ||
| .no_stdout() | ||
| .stderr_contains("Invalid cross-device link"); | ||
| .stderr_contains("ross-device link"); // cover both of glibc and musl |
There was a problem hiding this comment.
| .stderr_contains("ross-device link"); // cover both of glibc and musl | |
| .stderr_contains(if cfg!(target_env = "musl") { | |
| "ross-device link" | |
| } else { | |
| "Invalid cross-device link" | |
| }); |
I'd prefer to be more explicit here.
There was a problem hiding this comment.
I don't think there is worth to increase complexity at here just for test.
There was a problem hiding this comment.
I think the explicit cfg!(target_env = "musl") is worthwhile here. The test is covering a known difference in the diagnostic, so checking the expected string for each environment makes that clearer. The added complexity is small and limited to the test.
There was a problem hiding this comment.
It does not cover the case musl started aligning message with GNU at some version (or inverse).
There was a problem hiding this comment.
If the platform message changes, I think it's useful for the test to fail. It flags the change and lets us decide if anything needs updating.
There was a problem hiding this comment.
To be honest I think we should split test into separate test_cp_reflink_always_invalid_argument and test_cp_reflink_always_cross_device tests.
There was a problem hiding this comment.
don't hesitate to submit a new PR :)
Closes #14274