Closed lionel-rowe closed 1 month ago
Describe the bug
assertEquals sometimes gives wrong result for complex keys
assertEquals
Steps to Reproduce
// throws assertFalse( equal(new Set([{ b: 2 }, { a: 1 }]), new Set([{ a: 1 }, { b: 3 }])), );
Caused by these 2 lines:
https://github.com/denoland/std/blob/d102a10235b5d8d569e08cf9b53902a650f91a1c/assert/equal.ts#L92-L93
Because compare can be called twice at the same level, and the results can be different due to checking seen, the results are sometimes wrong.
compare
seen
Expected behavior
assertEquals consistently gives correct result for complex keys
Environment
Latest std/assert
Let's close this for now as the given example is now fixed
Please file a new issue if you find a new one
Describe the bug
assertEquals
sometimes gives wrong result for complex keysSteps to Reproduce
Caused by these 2 lines:
https://github.com/denoland/std/blob/d102a10235b5d8d569e08cf9b53902a650f91a1c/assert/equal.ts#L92-L93
Because
compare
can be called twice at the same level, and the results can be different due to checkingseen
, the results are sometimes wrong.Expected behavior
assertEquals
consistently gives correct result for complex keysEnvironment
Latest std/assert