mirror of https://github.com/zkat/miette.git
test: update tests to fit new api stuff
This commit is contained in:
parent
9d6015996b
commit
a05a6c519a
|
|
@ -71,19 +71,19 @@ fn single_line_highlight_with_empty_span() -> Result<(), MietteError> {
|
||||||
#[error("oops!")]
|
#[error("oops!")]
|
||||||
#[diagnostic(code(oops::my::bad), help("try doing it better next time?"))]
|
#[diagnostic(code(oops::my::bad), help("try doing it better next time?"))]
|
||||||
struct MyBad {
|
struct MyBad {
|
||||||
src: String,
|
src: NamedSource,
|
||||||
#[snippet(src, "This is the part that broke")]
|
#[snippet(src, message("This is the part that broke"))]
|
||||||
ctx: SourceSpan,
|
ctx: SourceSpan,
|
||||||
#[highlight(ctx)]
|
#[highlight(ctx, label = "this bit here")]
|
||||||
highlight: SourceSpan,
|
highlight: SourceSpan,
|
||||||
}
|
}
|
||||||
|
|
||||||
let src = "source\n text\n here".to_string();
|
let src = "source\n text\n here".to_string();
|
||||||
let len = src.len();
|
let len = src.len();
|
||||||
let err = MyBad {
|
let err = MyBad {
|
||||||
src,
|
src: NamedSource::new("bad_file.rs", src),
|
||||||
ctx: ("bad_file.rs", 0, len).into(),
|
ctx: (0, len).into(),
|
||||||
highlight: ("this bit here", 9, 0).into(),
|
highlight: (9, 0).into(),
|
||||||
};
|
};
|
||||||
let out = fmt_report(err.into());
|
let out = fmt_report(err.into());
|
||||||
println!("{}", out);
|
println!("{}", out);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue