aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api_light/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-14 13:27:08 +0000
committerAleksey Kladov <[email protected]>2019-01-15 11:18:24 +0000
commitd79a9b17dc4fb132443aa4ec1ca0ab278d2a217c (patch)
tree525b697381048b2f6d615a9c66c92485db8511ec /crates/ra_ide_api_light/src/lib.rs
parent8caff4e03475c20392f13e8c6ad469bd01a4b4ce (diff)
switch to insta for testing
Diffstat (limited to 'crates/ra_ide_api_light/src/lib.rs')
-rw-r--r--crates/ra_ide_api_light/src/lib.rs13
1 files changed, 3 insertions, 10 deletions
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 {
132#[cfg(test)] 132#[cfg(test)]
133mod tests { 133mod tests {
134 use ra_syntax::AstNode; 134 use ra_syntax::AstNode;
135 use insta::assert_debug_snapshot_matches;
135 136
136 use crate::test_utils::{add_cursor, assert_eq_dbg, assert_eq_text, extract_offset}; 137 use crate::test_utils::{add_cursor, assert_eq_text, extract_offset};
137 138
138 use super::*; 139 use super::*;
139 140
@@ -147,15 +148,7 @@ fn main() {}
147"#, 148"#,
148 ); 149 );
149 let hls = highlight(file.syntax()); 150 let hls = highlight(file.syntax());
150 assert_eq_dbg( 151 assert_debug_snapshot_matches!("highlighting", hls);
151 r#"[HighlightedRange { range: [1; 11), tag: "comment" },
152 HighlightedRange { range: [12; 14), tag: "keyword" },
153 HighlightedRange { range: [15; 19), tag: "function" },
154 HighlightedRange { range: [29; 37), tag: "macro" },
155 HighlightedRange { range: [38; 50), tag: "string" },
156 HighlightedRange { range: [52; 54), tag: "literal" }]"#,
157 &hls,
158 );
159 } 152 }
160 153
161 #[test] 154 #[test]