Skip to content

Assert.assertEqualsNoOrder does not check elements deeply #2500

Description

@Marcono1234

TestNG Version

7.4.0

Expected behavior

  • Either: Documentation for Assert.assertEqualsNoOrder should say that array elements are not compared deeply
  • Or: assertEqualsNoOrder should compare the array arguments deeply (i.e. compare nested array elements as well)

Actual behavior

assertEqualsNoOrder only compares array elements at the first nesting depth, but for deeper nesting depths arrays are compared by reference.

Test case sample

String[][] expected = {{}};
String[][] actual = {{}};
// EXPECTED: No exception
// ACTUAL: AssertionError
org.testng.Assert.assertEqualsNoOrder(actual, expected);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: assertionsAssert / assertEquals and assertion utilitiesType: Feature requestRequest for a new feature or enhancement

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions