Skip to content

ui tests should just show the stderr diff #46826

Closed
@nikomatsakis

Description

Currently, when a UI test fails, it prints a sort of overwhelming amount of stuff:

println!("normalized {}:\n{}\n", kind, actual);
println!("expected {}:\n{}\n", kind, expected);
println!("diff of {}:\n", kind);
for diff in diff::lines(expected, actual) {
match diff {
diff::Result::Left(l) => println!("-{}", l),
diff::Result::Both(l, _) => println!(" {}", l),
diff::Result::Right(r) => println!("+{}", r),
}
}

I think what I would like is something like:

If the expected text is empty, just dump the actual (normalized) output, so people can copy-and-paste it if they want.

Else, just print the diff. And probably it'd be nice to strip off the "prefix" and "suffix" of unchanged lines, and just show the parts that vary (we could imagine breaking things into hunks).

Activity

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

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions