1
Fork 0

Enable rand based libcore tests

Part of #806
This commit is contained in:
bjorn3 2022-03-18 21:19:37 +01:00
parent 6b0c411fe7
commit 31329f9841
2 changed files with 20 additions and 33 deletions

View file

@ -18,7 +18,7 @@ new file mode 100644
index 0000000..46fd999 index 0000000..46fd999
--- /dev/null --- /dev/null
+++ b/library/core/tests/Cargo.toml +++ b/library/core/tests/Cargo.toml
@@ -0,0 +1,8 @@ @@ -0,0 +1,11 @@
+[package] +[package]
+name = "core" +name = "core"
+version = "0.0.0" +version = "0.0.0"
@ -27,18 +27,9 @@ index 0000000..46fd999
+[lib] +[lib]
+name = "coretests" +name = "coretests"
+path = "lib.rs" +path = "lib.rs"
diff --git a/library/core/tests/num/flt2dec/mod.rs b/library/core/tests/num/flt2dec/mod.rs +
index a35897e..f0bf645 100644 +[dependencies]
--- a/library/core/tests/num/flt2dec/mod.rs +rand = "0.7"
+++ b/library/core/tests/num/flt2dec/mod.rs
@@ -13,7 +13,6 @@ mod strategy {
mod dragon;
mod grisu;
}
-mod random;
pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
match decode(v).1 {
diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs
index 1a6be3a..42dbd59 100644 index 1a6be3a..42dbd59 100644
--- a/library/core/tests/ptr.rs --- a/library/core/tests/ptr.rs
@ -59,25 +50,5 @@ index 1a6be3a..42dbd59 100644
#[test] #[test]
fn write_unaligned_drop() { fn write_unaligned_drop() {
diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
index 6609bc3..241b497 100644
--- a/library/core/tests/slice.rs
+++ b/library/core/tests/slice.rs
@@ -1209,6 +1209,7 @@ fn brute_force_rotate_test_1() {
}
}
+/*
#[test]
#[cfg(not(target_arch = "wasm32"))]
fn sort_unstable() {
@@ -1394,6 +1395,7 @@ fn partition_at_index() {
v.select_nth_unstable(0);
assert!(v == [0xDEADBEEF]);
}
+*/
#[test]
#[should_panic(expected = "index 0 greater than length of slice")]
-- --
2.21.0 (Apple Git-122) 2.21.0 (Apple Git-122)

View file

@ -11,6 +11,22 @@ diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
index 8402833..84592e0 100644 index 8402833..84592e0 100644
--- a/library/core/tests/slice.rs --- a/library/core/tests/slice.rs
+++ b/library/core/tests/slice.rs +++ b/library/core/tests/slice.rs
@@ -1809,6 +1809,7 @@ fn sort_unstable() {
assert!(v == [0xDEADBEEF]);
}
+/*
#[test]
#[cfg(not(target_arch = "wasm32"))]
#[cfg_attr(miri, ignore)] // Miri is too slow
@@ -1914,6 +1915,7 @@ fn select_nth_unstable() {
v.select_nth_unstable(0);
assert!(v == [0xDEADBEEF]);
}
+*/
#[test]
#[should_panic(expected = "index 0 greater than length of slice")]
@@ -2462,6 +2462,7 @@ take_tests! { @@ -2462,6 +2462,7 @@ take_tests! {
#[cfg(not(miri))] // unused in Miri #[cfg(not(miri))] // unused in Miri
const EMPTY_MAX: &'static [()] = &[(); usize::MAX]; const EMPTY_MAX: &'static [()] = &[(); usize::MAX];