Skip to content

Commit

Permalink
Add a test for help and note but no labels
Browse files Browse the repository at this point in the history
  • Loading branch information
ISSOtm committed Nov 28, 2024
1 parent 759a44e commit 81157af
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,28 @@ mod tests {
")
}

#[test]
fn only_help_and_note() {
let source = "this should not be printed";
let msg = remove_trailing(
Report::build(ReportKind::Error, 0..0)
.with_config(no_color())
.with_message("Programming language \"Rest\" not found")
.with_help("a language with a similar name exists: Rust")
.with_note("perhaps you'd like some sleep?")
.finish()
.write_to_string(Source::from(source)),
);
assert_snapshot!(msg, @r###"
Error: Programming language "Rest" not found
│ Help: a language with a similar name exists: Rust
│ Note: perhaps you'd like some sleep?
──╯
"###)
}

#[test]
fn multi_source() {
let msg = remove_trailing(
Expand Down

0 comments on commit 81157af

Please sign in to comment.