-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Milestone
Description
TestNG Version
Note: only the latest version is supported
All known (confirmed in 7.3.0 and in master branch as at 25 May 2023)
Expected behavior
If two maps contain different keys, they should never be reported as equal.
Actual behavior
If two maps contain different keys, if the values for all such keys in the LHS map are null, they are reported as equal.
Is the issue reproducible on runner?
Everywhere I believe.
Test case sample
Please, share the test case (as small as possible) which shows the issue
Map<String,Object> map1 = new LinkedHashMap<>();
map1.put("a", 1);
map1.put("b", null);
Map<String,Object> map2 = new LinkedHashMap<>();
map2.put("a", 1);
map2.put("c", null);
Assert.assertEquals(map1, map2);
The above assertion passes, but clearly it shouldn't.
Contribution guidelines
Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.
I will open a fix shortly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels