From 2e165ae82eed1dc62f1f4c68e45440c143c7c8ef Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 10 Aug 2018 17:49:45 +0300 Subject: logging --- libeditor/tests/test.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libeditor/tests') diff --git a/libeditor/tests/test.rs b/libeditor/tests/test.rs index ab8254d16..2a84c5080 100644 --- a/libeditor/tests/test.rs +++ b/libeditor/tests/test.rs @@ -3,7 +3,7 @@ extern crate itertools; use std::fmt; use itertools::Itertools; -use libeditor::{File, TextRange}; +use libeditor::{ast, highlight, runnables, extend_selection, TextRange}; #[test] fn test_extend_selection() { @@ -12,9 +12,9 @@ fn test_extend_selection() { } "#); let range = TextRange::offset_len(18.into(), 0.into()); - let range = file.extend_selection(range).unwrap(); + let range = extend_selection(&file, range).unwrap(); assert_eq!(range, TextRange::from_to(17.into(), 18.into())); - let range = file.extend_selection(range).unwrap(); + let range = extend_selection(&file, range).unwrap(); assert_eq!(range, TextRange::from_to(15.into(), 20.into())); } @@ -25,7 +25,7 @@ fn test_highlighting() { fn main() {} println!("Hello, {}!", 92); "#); - let hls = file.highlight(); + let hls = highlight(&file); dbg_eq( &hls, r#"[HighlightedRange { range: [1; 11), tag: "comment" }, @@ -49,7 +49,7 @@ fn test_foo() {} #[ignore] fn test_foo() {} "#); - let runnables = file.runnables(); + let runnables = runnables(&file); dbg_eq( &runnables, r#"[Runnable { range: [1; 13), kind: Bin }, @@ -58,8 +58,8 @@ fn test_foo() {} ) } -fn file(text: &str) -> File { - File::new(text) +fn file(text: &str) -> ast::File { + ast::File::parse(text) } fn dbg_eq(actual: &impl fmt::Debug, expected: &str) { -- cgit v1.2.3