From e847a1b7a6b53d5663aae7396ea0f65485f1283e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 9 Aug 2018 12:47:34 +0300 Subject: hihglihgitng tests --- libeditor/src/lib.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'libeditor/src/lib.rs') diff --git a/libeditor/src/lib.rs b/libeditor/src/lib.rs index a0c003fb5..ef31efe35 100644 --- a/libeditor/src/lib.rs +++ b/libeditor/src/lib.rs @@ -13,6 +13,7 @@ pub struct File { inner: libsyntax2::File } +#[derive(Debug)] pub struct HighlightedRange { pub range: TextRange, pub tag: &'static str, @@ -102,22 +103,3 @@ impl<'f> Declaration<'f> { self.0.range() } } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_extend_selection() { - let text = r#"fn foo() { - 1 + 1 -} -"#; - let file = File::new(text); - let range = TextRange::offset_len(18.into(), 0.into()); - let range = file.extend_selection(range).unwrap(); - assert_eq!(range, TextRange::from_to(17.into(), 18.into())); - let range = file.extend_selection(range).unwrap(); - assert_eq!(range, TextRange::from_to(15.into(), 20.into())); - } -} -- cgit v1.2.3