switch to insta for testing

This commit is contained in:
Aleksey Kladov 2019-01-14 16:27:08 +03:00
parent 8caff4e034
commit d79a9b17dc
20 changed files with 495 additions and 195 deletions

View file

@ -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"),