Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/safe_outputs/add_pr_comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,9 @@ mod tests {
line: None,
status: "active".to_string(),
};
let result: Result<AddPrCommentResult, _> = params.try_into();
assert!(result.is_err());
let err: Result<AddPrCommentResult, _> = params.try_into();
let err = err.unwrap_err().to_string();
assert!(err.contains("pull_request_id must be positive"), "got: {err}");
}

#[test]
Expand All @@ -566,8 +567,9 @@ mod tests {
line: None,
status: "active".to_string(),
};
let result: Result<AddPrCommentResult, _> = params.try_into();
assert!(result.is_err());
let err: Result<AddPrCommentResult, _> = params.try_into();
let err = err.unwrap_err().to_string();
assert!(err.contains("content must be at least 10 characters"), "got: {err}");
}

#[test]
Expand All @@ -581,8 +583,9 @@ mod tests {
line: None,
status: "active".to_string(),
};
let result: Result<AddPrCommentResult, _> = params.try_into();
assert!(result.is_err());
let err: Result<AddPrCommentResult, _> = params.try_into();
let err = err.unwrap_err().to_string();
assert!(err.contains("pipeline command"), "got: {err}");
}

#[test]
Expand Down Expand Up @@ -626,8 +629,9 @@ mod tests {
line: Some(10),
status: "active".to_string(),
};
let result: Result<AddPrCommentResult, _> = params.try_into();
assert!(result.is_err());
let err: Result<AddPrCommentResult, _> = params.try_into();
let err = err.unwrap_err().to_string();
assert!(err.contains("line requires file_path"), "got: {err}");
}

#[test]
Expand Down
5 changes: 3 additions & 2 deletions src/safe_outputs/update_pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,8 +1059,9 @@ mod tests {
vote: None,
description: None,
};
let result: Result<UpdatePrResult, _> = params.try_into();
assert!(result.is_err());
let err: Result<UpdatePrResult, _> = params.try_into();
let err = err.unwrap_err().to_string();
assert!(err.contains("operation must be one of"), "got: {err}");
}

#[test]
Expand Down
Loading