diff options
| author | kennytm <kennytm@gmail.com> | 2019-02-16 00:55:55 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2019-02-16 14:11:44 +0800 |
| commit | 0fecb6d97d0b548a2b3d23f30f384b13d4a9251e (patch) | |
| tree | 41971db282130d6700592e3e9e719cc3f934ad8d /src/liballoc/tests/string.rs | |
| parent | 13b055d5db67ab6c88d6379b7677069482db6077 (diff) | |
| parent | c154bf7db4d5737b55c6f85c69df136c374db3a5 (diff) | |
| download | rust-0fecb6d97d0b548a2b3d23f30f384b13d4a9251e.tar.gz rust-0fecb6d97d0b548a2b3d23f30f384b13d4a9251e.zip | |
Rollup merge of #58433 - RalfJung:miri-mark-tests, r=TimNN
Update which libcore/liballoc tests Miri ignores, and document why
Diffstat (limited to 'src/liballoc/tests/string.rs')
| -rw-r--r-- | src/liballoc/tests/string.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/liballoc/tests/string.rs b/src/liballoc/tests/string.rs index e6ca54c4088..7e93d84fe3b 100644 --- a/src/liballoc/tests/string.rs +++ b/src/liballoc/tests/string.rs @@ -1,5 +1,3 @@ -#![cfg(not(miri))] - use std::borrow::Cow; use std::collections::CollectionAllocErr::*; use std::mem::size_of; @@ -233,6 +231,7 @@ fn test_split_off_empty() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn test_split_off_past_end() { let orig = "Hello, world!"; let mut split = String::from(orig); @@ -241,6 +240,7 @@ fn test_split_off_past_end() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn test_split_off_mid_char() { let mut orig = String::from("山"); orig.split_off(1); @@ -289,6 +289,7 @@ fn test_str_truncate_invalid_len() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn test_str_truncate_split_codepoint() { let mut s = String::from("\u{FC}"); // ü s.truncate(1); @@ -323,6 +324,7 @@ fn remove() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn remove_bad() { "ศ".to_string().remove(1); } @@ -358,11 +360,13 @@ fn insert() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn insert_bad1() { "".to_string().insert(1, 't'); } #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn insert_bad2() { "ệ".to_string().insert(1, 't'); } @@ -443,6 +447,7 @@ fn test_replace_range() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn test_replace_range_char_boundary() { let mut s = "Hello, 世界!".to_owned(); s.replace_range(..8, ""); @@ -459,6 +464,7 @@ fn test_replace_range_inclusive_range() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn test_replace_range_out_of_bounds() { let mut s = String::from("12345"); s.replace_range(5..6, "789"); @@ -466,6 +472,7 @@ fn test_replace_range_out_of_bounds() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn test_replace_range_inclusive_out_of_bounds() { let mut s = String::from("12345"); s.replace_range(5..=5, "789"); @@ -525,6 +532,7 @@ fn test_reserve_exact() { } #[test] +#[cfg(not(miri))] // Miri does not support signalling OOM fn test_try_reserve() { // These are the interesting cases: @@ -602,6 +610,7 @@ fn test_try_reserve() { } #[test] +#[cfg(not(miri))] // Miri does not support signalling OOM fn test_try_reserve_exact() { // This is exactly the same as test_try_reserve with the method changed. |
