We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 97cd85d + d16bbd1 commit 378274bCopy full SHA for 378274b
library/alloc/tests/vec.rs
@@ -401,6 +401,29 @@ fn test_zip_unzip() {
401
assert_eq!((3, 6), (left[2], right[2]));
402
}
403
404
+#[test]
405
+fn test_cmp() {
406
+ let x: &[isize] = &[1, 2, 3, 4, 5];
407
+ let cmp: &[isize] = &[1, 2, 3, 4, 5];
408
+ assert_eq!(&x[..], cmp);
409
+ let cmp: &[isize] = &[3, 4, 5];
410
+ assert_eq!(&x[2..], cmp);
411
+ let cmp: &[isize] = &[1, 2, 3];
412
+ assert_eq!(&x[..3], cmp);
413
+ let cmp: &[isize] = &[2, 3, 4];
414
+ assert_eq!(&x[1..4], cmp);
415
+
416
+ let x: Vec<isize> = vec![1, 2, 3, 4, 5];
417
418
419
420
421
422
423
424
425
+}
426
427
#[test]
428
fn test_vec_truncate_drop() {
429
static mut DROPS: u32 = 0;
src/test/ui/array-slice-vec/slice-2.rs
0 commit comments