diff options
| author | dylan_DPC <dylan.dpc@gmail.com> | 2020-01-04 23:41:17 +0530 |
|---|---|---|
| committer | dylan_DPC <dylan.dpc@gmail.com> | 2020-01-04 23:41:17 +0530 |
| commit | eb36688a01f0a51db53f6f830472f03836e4cf68 (patch) | |
| tree | 7f100b02875ad7dc6f8e41758e7c9a866878a729 /src/liballoc | |
| parent | c09dac10738791460ff4897f5b3d12b62b2be9cc (diff) | |
| download | rust-eb36688a01f0a51db53f6f830472f03836e4cf68.tar.gz rust-eb36688a01f0a51db53f6f830472f03836e4cf68.zip | |
add tests
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/tests/vec.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/liballoc/tests/vec.rs b/src/liballoc/tests/vec.rs index 19acc70c73c..bf4a31c72dd 100644 --- a/src/liballoc/tests/vec.rs +++ b/src/liballoc/tests/vec.rs @@ -132,6 +132,21 @@ fn test_extend_ref() { } #[test] +fn test_remove_item() { + let mut v = vec![1,2,3]; + v.remove_item(&1); + + assert_eq!(v.len(), 2); + assert_eq!(v, [2,3]); + + let mut w = vec![1,2,3]; + w.remove_item(&4); + + assert_eq!(w.len(), 3); + w.remove_item(&4); +} + +#[test] fn test_slice_from_mut() { let mut values = vec![1, 2, 3, 4, 5]; { |
