diff --git a/src/renderer/render.rs b/src/renderer/render.rs index 042c6e02..e8cb5fa4 100644 --- a/src/renderer/render.rs +++ b/src/renderer/render.rs @@ -89,7 +89,11 @@ pub(crate) fn render(renderer: &Renderer, groups: Report<'_>) -> String { max_line_num_len + 1, ); } - if peek.is_none() && g == 0 && group_len > 1 { + if peek.is_none() + && title_style == TitleStyle::MainHeader + && g == 0 + && group_len > 1 + { draw_col_separator_end( renderer, &mut buffer, diff --git a/tests/formatter.rs b/tests/formatter.rs index 87334091..64e96b69 100644 --- a/tests/formatter.rs +++ b/tests/formatter.rs @@ -315,6 +315,56 @@ error: assert_data_eq!(renderer.render(input), expected_unicode); } +#[test] +fn test_multi_group_no_snippet() { + let input = &[ + Group::with_title(Level::ERROR.primary_title("the core problem")), + Group::with_title(Level::NOTE.secondary_title("more information")), + Group::with_title(Level::HELP.secondary_title("a way to fix this")), + ]; + let expected_ascii = str![[r#" +error: the core problem + | +note: more information +help: a way to fix this +"#]]; + let renderer = Renderer::plain(); + assert_data_eq!(renderer.render(input), expected_ascii); + + let expected_unicode = str![[r#" +error: the core problem + ╰╴ +note: more information +help: a way to fix this +"#]]; + let renderer = renderer.decor_style(DecorStyle::Unicode); + assert_data_eq!(renderer.render(input), expected_unicode); +} + +#[test] +fn test_multi_secondary_group_no_snippet() { + let input = &[ + Group::with_title(Level::ERROR.secondary_title("the core problem")), + Group::with_title(Level::NOTE.secondary_title("more information")), + Group::with_title(Level::HELP.secondary_title("a way to fix this")), + ]; + let expected_ascii = str![[r#" +error: the core problem +note: more information +help: a way to fix this +"#]]; + let renderer = Renderer::plain(); + assert_data_eq!(renderer.render(input), expected_ascii); + + let expected_unicode = str![[r#" +error: the core problem +note: more information +help: a way to fix this +"#]]; + let renderer = renderer.decor_style(DecorStyle::Unicode); + assert_data_eq!(renderer.render(input), expected_unicode); +} + #[test] #[should_panic] fn test_i26() {