-
Notifications
You must be signed in to change notification settings - Fork 218
[ISSUE #5394]🧪Add test case for ExpressionType #5451
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
Conversation
|
🔊@WaterWhisperer 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
WalkthroughThis PR adds unit tests for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
rocketmq-common/src/common/filter/expression_type.rs (1)
30-44: LGTM! Comprehensive test coverage for ExpressionType.The test module successfully covers all functionality:
- Both constants (SQL92 and TAG) are verified
- All branches of
is_tag_typeare tested with representative inputs (None, empty string, exact match, and non-matches)The implementation is correct and fulfills the PR objectives.
Optional improvement: Consider splitting into focused test functions.
For slightly better test organization and failure reporting, you could optionally split this into two test functions:
🔎 Optional refactor
#[cfg(test)] mod tests { use super::*; #[test] - fn test_expression_type() { + fn test_constants() { assert_eq!(ExpressionType::SQL92, "SQL92"); assert_eq!(ExpressionType::TAG, "TAG"); + } + + #[test] + fn test_is_tag_type() { assert!(ExpressionType::is_tag_type(None)); assert!(ExpressionType::is_tag_type(Some(""))); assert!(ExpressionType::is_tag_type(Some("TAG"))); assert!(!ExpressionType::is_tag_type(Some("SQL92"))); assert!(!ExpressionType::is_tag_type(Some("OTHER"))); } }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rocketmq-common/src/common/filter/expression_type.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Check (fmt + clippy)
- GitHub Check: auto-approve
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5451 +/- ##
=======================================
Coverage 37.83% 37.84%
=======================================
Files 811 811
Lines 109903 109912 +9
=======================================
+ Hits 41582 41594 +12
+ Misses 68321 68318 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rocketmq-rust-bot
left a comment
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.
LGTM - All CI checks passed ✅
Which Issue(s) This PR Fixes(Closes)
Fixes #5394
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.