Skip to content

Remove non-working -StrictOrder from Should-BeEquivalent #2929

Description

@nohwnd

Should-BeEquivalent has a -StrictOrder switch that does not work. The parameter declaration is commented out in the param block, but the body still branches on $StrictOrder in two places (the array comparison and the DataTable comparison), so $StrictOrder is always unbound and both branches are dead. There is even a test that only passes because passing -StrictOrder throws a parameter binding error.

Remove it:

  • drop the commented # [Switch] $StrictOrder declaration,
  • remove the two dead if ($StrictOrder) branches and keep the order insensitive path,
  • remove the test that asserts -StrictOrder throws.

Found while auditing the new Should-* assertions for consistency, see #2874.

🤖

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions