We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ffb5c5 commit d16bbd1Copy full SHA for d16bbd1
library/alloc/tests/vec.rs
@@ -345,6 +345,29 @@ fn test_zip_unzip() {
345
assert_eq!((3, 6), (left[2], right[2]));
346
}
347
348
+#[test]
349
+fn test_cmp() {
350
+ let x: &[isize] = &[1, 2, 3, 4, 5];
351
+ let cmp: &[isize] = &[1, 2, 3, 4, 5];
352
+ assert_eq!(&x[..], cmp);
353
+ let cmp: &[isize] = &[3, 4, 5];
354
+ assert_eq!(&x[2..], cmp);
355
+ let cmp: &[isize] = &[1, 2, 3];
356
+ assert_eq!(&x[..3], cmp);
357
+ let cmp: &[isize] = &[2, 3, 4];
358
+ assert_eq!(&x[1..4], cmp);
359
+
360
+ let x: Vec<isize> = vec![1, 2, 3, 4, 5];
361
362
363
364
365
366
367
368
369
+}
370
371
#[test]
372
fn test_vec_truncate_drop() {
373
static mut DROPS: u32 = 0;
src/test/ui/array-slice-vec/slice-2.rs
0 commit comments