From be15541b031c036ce1b5f0d7f31c32dd398ba5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Thu, 30 May 2019 20:46:43 +0300 Subject: Sort hover results in tests --- crates/ra_ide_api/src/hover.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index a390dab65..9c35db2a4 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -5,7 +5,11 @@ use ra_syntax::{ }; use hir::HirDisplay; -use crate::{db::RootDatabase, RangeInfo, FilePosition, FileRange, display::{rust_code_markup, doc_text_for}}; +use crate::{ + db::RootDatabase, + RangeInfo, FilePosition, FileRange, + display::{rust_code_markup, doc_text_for}, +}; /// Contains the results when hovering over an item #[derive(Debug, Clone)] @@ -155,9 +159,11 @@ mod tests { fn check_hover_result(fixture: &str, expected: &[&str]) { let (analysis, position) = analysis_and_position(fixture); let hover = analysis.hover(position).unwrap().unwrap(); + let mut results = Vec::from(hover.info.results()); + results.sort(); for (markup, expected) in - hover.info.results().iter().zip(expected.iter().chain(std::iter::repeat(&""))) + results.iter().zip(expected.iter().chain(std::iter::repeat(&""))) { assert_eq!(trim_markup(&markup), *expected); } -- cgit v1.2.3