Skip to content

Commit 81157af

Browse files
committed
Add a test for help and note but no labels
1 parent 759a44e commit 81157af

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/write.rs

+22
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,28 @@ mod tests {
16051605
")
16061606
}
16071607

1608+
#[test]
1609+
fn only_help_and_note() {
1610+
let source = "this should not be printed";
1611+
let msg = remove_trailing(
1612+
Report::build(ReportKind::Error, 0..0)
1613+
.with_config(no_color())
1614+
.with_message("Programming language \"Rest\" not found")
1615+
.with_help("a language with a similar name exists: Rust")
1616+
.with_note("perhaps you'd like some sleep?")
1617+
.finish()
1618+
.write_to_string(Source::from(source)),
1619+
);
1620+
assert_snapshot!(msg, @r###"
1621+
Error: Programming language "Rest" not found
1622+
1623+
│ Help: a language with a similar name exists: Rust
1624+
1625+
│ Note: perhaps you'd like some sleep?
1626+
──╯
1627+
"###)
1628+
}
1629+
16081630
#[test]
16091631
fn multi_source() {
16101632
let msg = remove_trailing(

0 commit comments

Comments
 (0)