-
Notifications
You must be signed in to change notification settings - Fork 211
Add tests for era index #6518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for era index #6518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @sffc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request adds tests for era indices in the any_calendar.rs
file. The goal is to show the current status regarding issue #6444 and provide a clear understanding of what needs to be fixed. The changes primarily involve modifying the test functions single_test_roundtrip
and single_test_error
to accept era information as a tuple of (&str, Option<u8>)
instead of just &str
. This allows for testing of both the era code and its index. The existing tests are then updated to use the new format for era information.
Highlights
- Test Enhancement: The pull request enhances the existing tests to include era index validation, providing better coverage for calendar functionality.
- Parameter Update: The
single_test_roundtrip
andsingle_test_error
functions now accept a tuple for era information, allowing for testing of both era code and index. - Issue Tracking: This PR aims to provide a clear picture of the status of issue Formatting era index is really bad and will break in CLDR 48 #6444, making it easier for contributors to address the remaining problems.
Changelog
- components/calendar/src/any_calendar.rs
- Modified
single_test_roundtrip
function to acceptera
asOption<(&str, Option<u8>)>
. - Modified
single_test_error
function to acceptera
asOption<(&str, Option<u8>)>
. - Added era roundtrip assertion to
single_test_roundtrip
to validate era code and index. - Updated existing tests to use the new
era
tuple format, including Buddhist, Coptic, Ethiopian, EthioAA, Gregorian, Indian, Japanese, JapanExt, Persian, Hebrew, ROC, and Hijri calendars.
- Modified
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
In calendar's embrace,
Eras dance through time and space,
A test ensures all,
No dates will fall,
In temporal disgrace.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request introduces tests for era indices in the calendar components. The changes look good overall, but there are a few areas that could be improved for clarity and consistency.
Summary of Findings
- Clarity of test parameters: The
single_test_roundtrip
andsingle_test_error
functions now accept a tuple for theera
parameter, which includes both the era code and an optional era index. While this change is functional, it might be beneficial to clarify the purpose of the optional era index in the function documentation or comments. - Consistency in test cases: The test cases have been updated to include era indices. Ensure that all relevant test cases are updated consistently to reflect the new parameter structure.
Merge Readiness
The pull request is almost ready for merging. Addressing the clarity of test parameters would improve the overall quality of the code. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. At a minimum, the medium severity issues should be addressed before merging.
This function already had no documentation. We should add documentation for it, but I don't want to hold up this PR on that, since the PR is still a net improvement.
The build should fail if anything hasn't been updated. |
Shows us where we're at regarding #6444, so that if someone wants to fix it, they know what to fix.