From a05a6c519a53ceb521a2e728b7f6cd9dbdf03655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Sun, 22 Aug 2021 19:23:30 -0700 Subject: [PATCH] test: update tests to fit new api stuff --- tests/printer.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/printer.rs b/tests/printer.rs index f2f91aa..11330da 100644 --- a/tests/printer.rs +++ b/tests/printer.rs @@ -71,19 +71,19 @@ fn single_line_highlight_with_empty_span() -> Result<(), MietteError> { #[error("oops!")] #[diagnostic(code(oops::my::bad), help("try doing it better next time?"))] struct MyBad { - src: String, - #[snippet(src, "This is the part that broke")] + src: NamedSource, + #[snippet(src, message("This is the part that broke"))] ctx: SourceSpan, - #[highlight(ctx)] + #[highlight(ctx, label = "this bit here")] highlight: SourceSpan, } let src = "source\n text\n here".to_string(); let len = src.len(); let err = MyBad { - src, - ctx: ("bad_file.rs", 0, len).into(), - highlight: ("this bit here", 9, 0).into(), + src: NamedSource::new("bad_file.rs", src), + ctx: (0, len).into(), + highlight: (9, 0).into(), }; let out = fmt_report(err.into()); println!("{}", out);