-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show the message in case of should_panic
failure
#61068
Show the message in case of should_panic
failure
#61068
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
7df5f6d
to
0e53973
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good after fixing the string issues. You can use ./x.py check
to make sure everything type checks.
src/libtest/lib.rs
Outdated
@@ -1543,7 +1543,7 @@ fn calc_result(desc: &TestDesc, task_result: Result<(), Box<dyn Any + Send>>) -> | |||
} | |||
} | |||
_ if desc.allow_fail => TrAllowedFail, | |||
_ => TrFailed, | |||
_ => TrFailedMsg("test did not panic as expected"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ => TrFailedMsg("test did not panic as expected"), | |
_ => TrFailedMsg("test did not panic as expected".to_string()), |
src/libtest/lib.rs
Outdated
@@ -1923,7 +1923,7 @@ mod tests { | |||
let (tx, rx) = channel(); | |||
run_test(&TestOpts::new(), false, desc, tx, Concurrent::No); | |||
let (_, res, _) = rx.recv().unwrap(); | |||
assert!(res == TrFailed); | |||
assert!(res == TrFailedMsg("test did not panic as expected")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert!(res == TrFailedMsg("test did not panic as expected")); | |
assert!(res == TrFailedMsg("test did not panic as expected".to_string())); |
@bors r- Sorry, I didn't even spot that this wasn't passing. |
6236b80
to
f6f5fea
Compare
This comment has been minimized.
This comment has been minimized.
f6f5fea
to
7805691
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #61739) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
bf41a98
to
26d3518
Compare
This comment has been minimized.
This comment has been minimized.
26d3518
to
d68967d
Compare
This comment has been minimized.
This comment has been minimized.
@chansuke: looks like a test is still failing? |
src/libtest/lib.rs
Outdated
@@ -1541,7 +1541,7 @@ fn calc_result(desc: &TestDesc, task_result: Result<(), Box<dyn Any + Send>>) -> | |||
} | |||
} | |||
_ if desc.allow_fail => TrAllowedFail, | |||
_ => TrFailed, | |||
_ => TrFailedMsg("test did not panic as expected".to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't check carefully enough. This should be:
(&ShouldPanic::Yes, Ok(())) => TrFailedMsg("test did not panic as expected".to_string()),
_ => TrFailed,
src/libtest/tests.rs
Outdated
@@ -146,7 +145,7 @@ fn test_should_panic_but_succeeds() { | |||
let (tx, rx) = channel(); | |||
run_test(&TestOpts::new(), false, desc, tx, Concurrent::No); | |||
let (_, res, _) = rx.recv().unwrap(); | |||
assert!(res == TrFailed); | |||
assert!(res == TrFailedMsg("test did not panic as expected".to_string())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert!(res == TrFailedMsg("test did not panic as expected".to_string())); | |
assert_eq!(res, TrFailedMsg("test did not panic as expected".to_string())); |
If you look at the error in Travis, you'll see it says:
If you then look at the file |
Ping from triage @chansuke any update on this? All checks all failing at the moment. Thanks |
@gagan0723 Sorry for the late response, I will fix that now. |
d68967d
to
5dfe71e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ping from triage @chansuke, any update on this PR? thanks for your effort! |
e733944
to
333644a
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Closing due to inactivity. Thank you @chansuke for your work on this PR. Please reopen this PR when you have a chance to make necessary changes, and be warned that pushing to this PR while it is closed prevents it from being reopened. |
This PR fixes a problem in #60790. Closes #60790.