Skip to content

pr: test_merge_non_utf8_input_filename is failing #16147

Closed

Description

@xtqqczze
thread 'test_pr::test_merge_non_utf8_input_filename' (45205) panicked at tests/by-util/test_pr.rs:1437:10:
assertion failed: `(left == right)`

Diff < left / right > :
<left                               	right
>left                               	right

Activity

  1. Martell0x1 commented on Nov 3, 2026

    @Martell0x1
    Contributor

    investigating

  2. Martell0x1 commented on Nov 3, 2026

    @Martell0x1
    Contributor

    I investigated the failure and found that the expected output in the test was incorrect.

    The test expected both columns to be padded to 35 characters:

    format!("{:<35}\t{:<35}\n", "left", "right")

    However, pr intentionally does not pad the last cell of a merged row. This is also documented in get_line_for_printing():

    // Like GNU pr, the last cell of a row is not padded, so the
    // line has no trailing spaces.

    I verified this by inspecting the formatter and comparing the output with a valid UTF-8 filename. Both produce the same output, so the non-UTF-8 filename is not the cause of this particular failure.

    I updated the test expectation to:

    format!("{:<35}\t{}\n", "left", "right")

    The previously failing test now passes when run with ignored tests enabled.

    I'll open a PR with this test correction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions