aboutsummaryrefslogtreecommitdiff
path: root/src/slice/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/slice/test.rs')
-rw-r--r--src/slice/test.rs24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/slice/test.rs b/src/slice/test.rs
index 71743e2..f74ca0f 100644
--- a/src/slice/test.rs
+++ b/src/slice/test.rs
@@ -10,7 +10,7 @@ macro_rules! sort {
($f:ident, $name:ident) => {
#[test]
fn $name() {
- let ref mut rng = thread_rng();
+ let rng = &mut thread_rng();
for len in (0..25).chain(500..501) {
for &modulus in &[5, 10, 100] {
@@ -146,3 +146,25 @@ fn test_par_chunks_exact_mut_remainder() {
assert_eq!(c.take_remainder(), &[]);
assert_eq!(c.len(), 2);
}
+
+#[test]
+fn test_par_rchunks_exact_remainder() {
+ let v: &[i32] = &[0, 1, 2, 3, 4];
+ let c = v.par_rchunks_exact(2);
+ assert_eq!(c.remainder(), &[0]);
+ assert_eq!(c.len(), 2);
+}
+
+#[test]
+fn test_par_rchunks_exact_mut_remainder() {
+ let v: &mut [i32] = &mut [0, 1, 2, 3, 4];
+ let mut c = v.par_rchunks_exact_mut(2);
+ assert_eq!(c.remainder(), &[0]);
+ assert_eq!(c.len(), 2);
+ assert_eq!(c.into_remainder(), &[0]);
+
+ let mut c = v.par_rchunks_exact_mut(2);
+ assert_eq!(c.take_remainder(), &[0]);
+ assert_eq!(c.take_remainder(), &[]);
+ assert_eq!(c.len(), 2);
+}