More tests#20
Merged
gburgessiv merged 2 commits intomainfrom Feb 27, 2026
Merged
Conversation
I asked Claude to propose mostly-pure functions to add tests for. It had some good suggestions, some iffy. This PR contains the good suggestions.
7671dad to
954492d
Compare
There was a problem hiding this comment.
Pull request overview
Adds additional unit tests around small, mostly-pure helper logic (email parsing, Lab buildbot categorization/email cleanup, Discord duration formatting, and calendar ping/refresh timing), and simplifies an internal sortedness assertion by using the standard library helper.
Changes:
- Add targeted unit tests for
Email::parseplus a test-only constructor to ease assertions. - Expand unit test coverage in
lab.rs,discord.rs, andcalendar_events.rsfor string/time helpers. - Replace a custom
is_sorted_byhelper withslice::is_sorted_by.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| llvm_buildbot_monitor/src/main.rs | Adds test-only Email::from_parts and a new email_tests module for Email::parse. |
| llvm_buildbot_monitor/src/lab.rs | Adds helper builder() plus new unit tests for remove_name_from_email and determine_bot_category. |
| llvm_buildbot_monitor/src/greendragon.rs | Removes custom sortedness helper; uses build_list.is_sorted_by(...) in debug assertion. |
| llvm_buildbot_monitor/src/discord.rs | Adds unit tests covering boundary behavior of duration_to_shorthand. |
| llvm_buildbot_monitor/src/calendar_events.rs | Adds unit tests for ping-time calculation and refresh scheduling edge cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I asked Claude to propose mostly-pure functions to add tests for. It had some good suggestions, some iffy. This PR contains the good suggestions.