Skip to content

Commit

Permalink
feat: add assertions to tests for contains_error method in Summary
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Nov 25, 2024
1 parent 08a66fb commit f30bb6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/core/src/error/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ mod tests {

assert_eq!(summary.issues.len(), 1);

assert!(summary.contains_error());

let user_input_issues = summary
.issues
.get(&IssueCategory::Error)
Expand Down Expand Up @@ -481,6 +483,8 @@ mod tests {

assert_eq!(summary.issues.len(), 1);

assert!(summary.contains_error());

let user_input_issues = summary.issues.get(&IssueCategory::Error).unwrap();

let issue = user_input_issues.get(&IssueScope::UserInput).unwrap();
Expand Down Expand Up @@ -533,6 +537,8 @@ mod tests {

summary.complete();

assert!(summary.contains_error());

let display_output = format!("{summary}");

assert!(display_output.contains("Context: Check"));
Expand Down Expand Up @@ -601,6 +607,8 @@ mod tests {

other_summary.complete();

assert!(summary.contains_error());

summary.merge(other_summary);

assert_eq!(summary.issues.len(), 1);
Expand Down

0 comments on commit f30bb6e

Please sign in to comment.