From d79a9b17dc4fb132443aa4ec1ca0ab278d2a217c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jan 2019 16:27:08 +0300 Subject: switch to insta for testing --- crates/ra_ide_api_light/src/lib.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'crates/ra_ide_api_light/src/lib.rs') diff --git a/crates/ra_ide_api_light/src/lib.rs b/crates/ra_ide_api_light/src/lib.rs index 72fba9402..9dd72701d 100644 --- a/crates/ra_ide_api_light/src/lib.rs +++ b/crates/ra_ide_api_light/src/lib.rs @@ -132,8 +132,9 @@ pub fn syntax_tree(file: &SourceFile) -> String { #[cfg(test)] mod tests { use ra_syntax::AstNode; + use insta::assert_debug_snapshot_matches; - use crate::test_utils::{add_cursor, assert_eq_dbg, assert_eq_text, extract_offset}; + use crate::test_utils::{add_cursor, assert_eq_text, extract_offset}; use super::*; @@ -147,15 +148,7 @@ fn main() {} "#, ); let hls = highlight(file.syntax()); - assert_eq_dbg( - r#"[HighlightedRange { range: [1; 11), tag: "comment" }, - HighlightedRange { range: [12; 14), tag: "keyword" }, - HighlightedRange { range: [15; 19), tag: "function" }, - HighlightedRange { range: [29; 37), tag: "macro" }, - HighlightedRange { range: [38; 50), tag: "string" }, - HighlightedRange { range: [52; 54), tag: "literal" }]"#, - &hls, - ); + assert_debug_snapshot_matches!("highlighting", hls); } #[test] -- cgit v1.2.3