mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
switch to insta for testing
This commit is contained in:
parent
8caff4e034
commit
d79a9b17dc
20 changed files with 495 additions and 195 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue