-
Notifications
You must be signed in to change notification settings - Fork 60.2k
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
fix: close 5315 #5316
Closed
Closed
fix: close 5315 #5316
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
Refactor and improve parsing logic.
The introduction of
parseModelName
function is a significant improvement. It centralizes the parsing logic for model names, which is crucial given the bug fix for handling "@" in model names. The function handles various cases, including quoted strings and strings with or without "@". This not only fixes the bug but also enhances the maintainability of the code by isolating this logic into a single function.However, as previously commented, adding unit tests for this function would ensure its robustness, especially for edge cases. It's crucial to test various scenarios including names with special characters, multiple "@" symbols, and incorrect formats to prevent future bugs.
The function implementation is approved.
Would you like me to help with writing these unit tests or open a GitHub issue to track this task?
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.
Help me write unit tests
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.
@rxliuli, I've written the unit tests for the
parseModelName
function. Below are the test cases that cover various scenarios to ensure the function's robustness:These tests cover the basic cases, quoted names, names with "@" symbols, and some edge cases like multiple "@" symbols and incorrect formats. This should provide good coverage for the
parseModelName
function.Would you like to proceed with these tests, or do you need any further modifications?