mark failures expected due to panics

This commit is contained in:
Ralf Jung 2019-02-09 11:32:09 +01:00
parent e544947278
commit 26ade1cfaa
4 changed files with 15 additions and 15 deletions

View file

@ -255,7 +255,7 @@ fn test_iterator_step_by_nth_overflow() {
#[test]
#[should_panic]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_iterator_step_by_zero() {
let mut it = (0..).step_by(0);
it.next();
@ -1417,7 +1417,7 @@ fn test_rposition() {
#[test]
#[should_panic]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_rposition_panic() {
let v: [(Box<_>, Box<_>); 4] =
[(box 0, box 0), (box 0, box 0),

View file

@ -69,7 +69,7 @@ fn test_option_dance() {
}
#[test] #[should_panic]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_option_too_much_dance() {
struct A;
let mut y = Some(A);
@ -130,7 +130,7 @@ fn test_unwrap() {
#[test]
#[should_panic]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_unwrap_panic1() {
let x: Option<isize> = None;
x.unwrap();
@ -138,7 +138,7 @@ fn test_unwrap_panic1() {
#[test]
#[should_panic]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_unwrap_panic2() {
let x: Option<String> = None;
x.unwrap();

View file

@ -117,7 +117,7 @@ fn test_unwrap_or_else() {
#[test]
#[should_panic]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
pub fn test_unwrap_or_else_panic() {
fn handler(msg: &'static str) -> isize {
if msg == "I got this." {
@ -139,7 +139,7 @@ pub fn test_expect_ok() {
}
#[test]
#[should_panic(expected="Got expected error: \"All good\"")]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
pub fn test_expect_err() {
let err: Result<isize, &'static str> = Err("All good");
err.expect("Got expected error");
@ -153,7 +153,7 @@ pub fn test_expect_err_err() {
}
#[test]
#[should_panic(expected="Got expected ok: \"All good\"")]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
pub fn test_expect_err_ok() {
let err: Result<&'static str, isize> = Ok("All good");
err.expect_err("Got expected ok");

View file

@ -782,7 +782,7 @@ mod slice_index {
// to be used in `should_panic`)
#[test]
#[should_panic(expected = "out of range")]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn assert_range_eq_can_fail_by_panic() {
assert_range_eq!([0, 1, 2], 0..5, [0, 1, 2]);
}
@ -792,7 +792,7 @@ mod slice_index {
// to be used in `should_panic`)
#[test]
#[should_panic(expected = "==")]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn assert_range_eq_can_fail_by_inequality() {
assert_range_eq!([0, 1, 2], 0..2, [0, 1, 2]);
}
@ -842,7 +842,7 @@ mod slice_index {
#[test]
#[should_panic(expected = $expect_msg)]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn index_fail() {
let v = $data;
let v: &[_] = &v;
@ -851,7 +851,7 @@ mod slice_index {
#[test]
#[should_panic(expected = $expect_msg)]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn index_mut_fail() {
let mut v = $data;
let v: &mut [_] = &mut v;
@ -1306,7 +1306,7 @@ fn test_copy_within() {
#[test]
#[should_panic(expected = "src is out of bounds")]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_copy_within_panics_src_too_long() {
let mut bytes = *b"Hello, World!";
// The length is only 13, so 14 is out of bounds.
@ -1315,7 +1315,7 @@ fn test_copy_within_panics_src_too_long() {
#[test]
#[should_panic(expected = "dest is out of bounds")]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_copy_within_panics_dest_too_long() {
let mut bytes = *b"Hello, World!";
// The length is only 13, so a slice of length 4 starting at index 10 is out of bounds.
@ -1323,7 +1323,7 @@ fn test_copy_within_panics_dest_too_long() {
}
#[test]
#[should_panic(expected = "src end is before src start")]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn test_copy_within_panics_src_inverted() {
let mut bytes = *b"Hello, World!";
// 2 is greater than 1, so this range is invalid.