deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

assertStrictEquals(-0, +0) should not throw

Open rherrmann opened this issue 1 month ago • 0 comments

Describe the Bug According to the Strict Equality Comparison Algorithm of the Javascript standard, -0 and +0 are considered equal.

Assuming that assertStrictEquals is meant to assert equality in the sense of actual === expected, it should not throw when passing -0 and +0 for actual and expected.

Steps to Reproduce

import { assert, assertStrictEquals } from "https://deno.land/[email protected]/assert/mod.ts";

assert(-0 === +0); // passes
assertStrictEquals(-0, +0); // fails

Expected Behavior assertStrictEquals(-0, +0) should not throw.

Environment

  • OS: macOS
  • deno version: 1.43.2
  • std version: 0.224

rherrmann avatar May 11 '24 12:05 rherrmann