diff options
author | Aleksey Kladov <[email protected]> | 2019-03-14 10:27:21 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-03-14 10:28:45 +0000 |
commit | 8774067a879a814940b9917efd13c40d8e0fc8b2 (patch) | |
tree | 6525f0a71cad6507c139ae4dc6848594d8269ec3 /crates/ra_ide_api/src | |
parent | a0ded3f7c0353cdd61e9dc0ddd8e64ba8c1e64ef (diff) |
sort navigations to make tests stable
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/impls.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/impls.rs b/crates/ra_ide_api/src/impls.rs index 896b47f10..ee9220a15 100644 --- a/crates/ra_ide_api/src/impls.rs +++ b/crates/ra_ide_api/src/impls.rs | |||
@@ -81,8 +81,9 @@ mod tests { | |||
81 | fn check_goto(fixture: &str, expected: &[&str]) { | 81 | fn check_goto(fixture: &str, expected: &[&str]) { |
82 | let (analysis, pos) = analysis_and_position(fixture); | 82 | let (analysis, pos) = analysis_and_position(fixture); |
83 | 83 | ||
84 | let navs = analysis.goto_implementation(pos).unwrap().unwrap().info; | 84 | let mut navs = analysis.goto_implementation(pos).unwrap().unwrap().info; |
85 | assert_eq!(navs.len(), expected.len()); | 85 | assert_eq!(navs.len(), expected.len()); |
86 | navs.sort_by_key(|nav| (nav.file_id(), nav.full_range().start())); | ||
86 | navs.into_iter().enumerate().for_each(|(i, nav)| nav.assert_match(expected[i])); | 87 | navs.into_iter().enumerate().for_each(|(i, nav)| nav.assert_match(expected[i])); |
87 | } | 88 | } |
88 | 89 | ||