-
Notifications
You must be signed in to change notification settings - Fork 1k
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 assertEqualsDeep(Set, Set, String)
wrong comparison and add variant without message
#3150
Fix assertEqualsDeep(Set, Set, String)
wrong comparison and add variant without message
#3150
Conversation
WalkthroughThis update to TestNG introduces fixes for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Assert
participant AssertTest
User->>Assert: Calls assertEqualsDeep(Set actual, Set expected)
Assert->>Assert: Calls internal areEqualImpl(value, expectedValue)
Assert->>User: Returns result of deep comparison
User->>AssertTest: Runs testAssertEqualsDeepSet
AssertTest->>Assert: Calls assertEqualsDeep(Set actual, Set expected)
Assert->>AssertTest: Returns result (pass)
User->>AssertTest: Runs testAssertEqualsDeepSetFail
AssertTest->>Assert: Calls assertEqualsDeep(Set actual, Set expected)
Assert->>AssertTest: Returns result (fail)
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- CHANGES.txt (1 hunks)
- testng-asserts/src/main/java/org/testng/Assert.java (1 hunks)
- testng-asserts/src/test/java/org/testng/AssertTest.java (1 hunks)
Additional comments not posted (5)
testng-asserts/src/test/java/org/testng/AssertTest.java (2)
583-592
: LGTM! The test functiontestAssertEqualsDeepSet
is correctly implemented.The function verifies the deep equality of Sets with nested arrays and objects.
594-603
: LGTM! The test functiontestAssertEqualsDeepSetFail
is correctly implemented.The function verifies the deep inequality of Sets with nested arrays and objects.
testng-asserts/src/main/java/org/testng/Assert.java (2)
2070-2075
: LGTM! Deep comparison for sets is correctly implemented.The addition of
areEqualImpl
for deep comparison of set elements is appropriate and aligns with the PR objectives.
2078-2081
: LGTM! New methods for deep comparison of sets are correctly implemented.The new overloaded methods
assertEqualsDeep(Set<?> actual, Set<?> expected)
andassertEqualsDeep(Set<?> actual, Set<?> expected, String message)
provide the required functionality for deep comparison of sets.CHANGES.txt (1)
5-5
: LGTM!The changelog entry for GITHUB-3140 is correctly formatted and provides a brief description of the fix.
2df6a79
to
1c8e230
Compare
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- CHANGES.txt (1 hunks)
- testng-asserts/src/main/java/org/testng/Assert.java (1 hunks)
- testng-asserts/src/test/java/org/testng/AssertTest.java (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- CHANGES.txt
- testng-asserts/src/main/java/org/testng/Assert.java
- testng-asserts/src/test/java/org/testng/AssertTest.java
Fixes #3140.
This PR intends to fix the error reported in #3140, while also introducing another method
assertEqualsDeep(Set, Set)
, in the same fashion as other methods in the class.Did you remember to?
CHANGES.txt
./gradlew autostyleApply
We encourage pull requests that:
If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.
Note: For more information on contribution guidelines please make sure you refer our Contributing section for detailed set of steps.
Summary by CodeRabbit
Bug Fixes
assertEqualsDeep
for Sets to ensure accurate expected value matching.New Features
assertEqualsDeep
methods for Sets with optional custom error messages to improve assertion capabilities.