mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 15:47:31 +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
|
@ -1,8 +1,6 @@
|
|||
use std::fmt;
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use itertools::Itertools;
|
||||
use text_unit::{TextRange, TextUnit};
|
||||
use serde_json::Value;
|
||||
|
||||
|
@ -31,12 +29,6 @@ macro_rules! assert_eq_text {
|
|||
}};
|
||||
}
|
||||
|
||||
pub fn assert_eq_dbg(expected: &str, actual: &impl fmt::Debug) {
|
||||
let actual = format!("{:?}", actual);
|
||||
let expected = expected.lines().map(|l| l.trim()).join(" ");
|
||||
assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
pub fn extract_offset(text: &str) -> (TextUnit, String) {
|
||||
match try_extract_offset(text) {
|
||||
None => panic!("text should contain cursor marker"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue