Skip to content

Commit

Permalink
Move Vec slice UI tests in library
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush Kumar Mishra committed Sep 4, 2020
1 parent 4ffb5c5 commit d16bbd1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 62 deletions.
23 changes: 23 additions & 0 deletions library/alloc/tests/vec.rs
Expand Up @@ -345,6 +345,29 @@ fn test_zip_unzip() {
assert_eq!((3, 6), (left[2], right[2]));
}

#[test]
fn test_cmp() {
let x: &[isize] = &[1, 2, 3, 4, 5];
let cmp: &[isize] = &[1, 2, 3, 4, 5];
assert_eq!(&x[..], cmp);
let cmp: &[isize] = &[3, 4, 5];
assert_eq!(&x[2..], cmp);
let cmp: &[isize] = &[1, 2, 3];
assert_eq!(&x[..3], cmp);
let cmp: &[isize] = &[2, 3, 4];
assert_eq!(&x[1..4], cmp);

let x: Vec<isize> = vec![1, 2, 3, 4, 5];
let cmp: &[isize] = &[1, 2, 3, 4, 5];
assert_eq!(&x[..], cmp);
let cmp: &[isize] = &[3, 4, 5];
assert_eq!(&x[2..], cmp);
let cmp: &[isize] = &[1, 2, 3];
assert_eq!(&x[..3], cmp);
let cmp: &[isize] = &[2, 3, 4];
assert_eq!(&x[1..4], cmp);
}

#[test]
fn test_vec_truncate_drop() {
static mut DROPS: u32 = 0;
Expand Down
62 changes: 0 additions & 62 deletions src/test/ui/array-slice-vec/slice-2.rs

This file was deleted.

0 comments on commit d16bbd1

Please sign in to comment.