diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-30 18:51:51 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-30 18:51:51 -0800 |
| commit | 67d13883f868e6b27aa00a6c69f7c748d16e1c94 (patch) | |
| tree | 195395a9e6d556c7c60a1507376a75e9e0c348bb /src/libcoretest | |
| parent | dd0f29ad0f3ddc48f36340cd0abff4712e882a3e (diff) | |
| parent | 6abfac083feafc73e5d736177755cce3bfb7153f (diff) | |
| download | rust-67d13883f868e6b27aa00a6c69f7c748d16e1c94.tar.gz rust-67d13883f868e6b27aa00a6c69f7c748d16e1c94.zip | |
rollup merge of #20061: aturon/stab-2-vec-slice
Conflicts: src/libcollections/slice.rs src/libcollections/vec.rs src/libstd/sys/windows/os.rs
Diffstat (limited to 'src/libcoretest')
| -rw-r--r-- | src/libcoretest/slice.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libcoretest/slice.rs b/src/libcoretest/slice.rs index 987da903211..9ef7d603059 100644 --- a/src/libcoretest/slice.rs +++ b/src/libcoretest/slice.rs @@ -8,30 +8,30 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::slice::BinarySearchResult::{Found, NotFound}; +use core::result::Result::{Ok, Err}; #[test] fn binary_search_not_found() { let b = [1i, 2, 4, 6, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&6)) == Found(3)); + assert!(b.binary_search_by(|v| v.cmp(&6)) == Ok(3)); let b = [1i, 2, 4, 6, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&5)) == NotFound(3)); + assert!(b.binary_search_by(|v| v.cmp(&5)) == Err(3)); let b = [1i, 2, 4, 6, 7, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&6)) == Found(3)); + assert!(b.binary_search_by(|v| v.cmp(&6)) == Ok(3)); let b = [1i, 2, 4, 6, 7, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&5)) == NotFound(3)); + assert!(b.binary_search_by(|v| v.cmp(&5)) == Err(3)); let b = [1i, 2, 4, 6, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&8)) == Found(4)); + assert!(b.binary_search_by(|v| v.cmp(&8)) == Ok(4)); let b = [1i, 2, 4, 6, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&7)) == NotFound(4)); + assert!(b.binary_search_by(|v| v.cmp(&7)) == Err(4)); let b = [1i, 2, 4, 6, 7, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&8)) == Found(5)); + assert!(b.binary_search_by(|v| v.cmp(&8)) == Ok(5)); let b = [1i, 2, 4, 5, 6, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&7)) == NotFound(5)); + assert!(b.binary_search_by(|v| v.cmp(&7)) == Err(5)); let b = [1i, 2, 4, 5, 6, 8, 9]; - assert!(b.binary_search(|v| v.cmp(&0)) == NotFound(0)); + assert!(b.binary_search_by(|v| v.cmp(&0)) == Err(0)); let b = [1i, 2, 4, 5, 6, 8]; - assert!(b.binary_search(|v| v.cmp(&9)) == NotFound(6)); + assert!(b.binary_search_by(|v| v.cmp(&9)) == Err(6)); } #[test] |
