node icon indicating copy to clipboard operation
node copied to clipboard

unexpected diff on assert.deepStrictEqual

Open oriongonza opened this issue 1 year ago • 3 comments

Version

v20.5.0 (tried on node 16 and 21)

Platform

([ronment]::OSVersion.VersionString) x64

What steps will reproduce the bug?

require("assert").deepStrictEqual(
  {
    common: {},
    key1: "",
    creator: "123",
  },
  {
    creator: "123",
  },
);

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Only comon and key1 exist so

  {
+   common: {},
+   key1: ''
  }

What do you see instead?

  {
+   common: {},
+   creator: '123',
+   key1: ''
-   creator: '123'
  }

Additional information

No response

oriongonza avatar Feb 12 '24 13:02 oriongonza

It happened to me as well.

alepefe avatar Feb 12 '24 13:02 alepefe

The current implementation for the diff is a quick best effort implementation and we have to change it to Myers algorithm or similar to properly detect these changes without a bad runtime.

BridgeAR avatar Feb 12 '24 16:02 BridgeAR

Would a fix to this get added to node 20?

oriongonza avatar Feb 13 '24 14:02 oriongonza

There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the https://github.com/nodejs/node/labels/never-stale label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document.

github-actions[bot] avatar Aug 12 '24 01:08 github-actions[bot]

bump

oriongonza avatar Aug 12 '24 08:08 oriongonza