Skip to content

Commit 2934b58

Browse files
committed
Add a test for help and note but no labels
1 parent 3b7163c commit 2934b58

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/write.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,26 @@ mod tests {
14491449
"###)
14501450
}
14511451

1452+
#[test]
1453+
fn only_help_and_note() {
1454+
let source = "this should not be printed";
1455+
let msg = Report::<Range<usize>>::build(ReportKind::Error, (), 0)
1456+
.with_config(no_color())
1457+
.with_message("Programming language \"Rest\" not found")
1458+
.with_help("a language with a similar name exists: Rust")
1459+
.with_note("perhaps you'd like some sleep?")
1460+
.finish()
1461+
.write_to_string(Source::from(source));
1462+
assert_snapshot!(msg, @r###"
1463+
Error: Programming language "Rest" not found
1464+
1465+
│ Help: a language with a similar name exists: Rust
1466+
1467+
│ Note: perhaps you'd like some sleep?
1468+
──╯
1469+
"###)
1470+
}
1471+
14521472
#[test]
14531473
fn multi_source() {
14541474
let msg = Report::build(ReportKind::Error, 0usize, 0)

0 commit comments

Comments
 (0)