Skip to content

@std/assert/{assertEquals ,assertNotEquals} not handle ArrayBuffer correctly #6814

@imcotton

Description

@imcotton

Describe the bug

Getting wrong results against ArrayBuffer.

Steps to Reproduce

import { assertEquals, assertNotEquals } from 'jsr:@std/[email protected]';

const a = Uint8Array.of(1);
const b = Uint8Array.of(2);

Deno.test('assertEquals', function () {
    assertEquals(a.buffer, b.buffer);
});

Deno.test('assertNotEquals', function () {
    assertNotEquals(a.buffer, b.buffer);
});

Expected behavior

assertEquals ... FAILED
assertNotEquals ... ok

Getting instead

assertEquals ... ok
assertNotEquals ... FAILED

Environment

  • OS: MacOS 15.5
  • deno version: 2.4.5
  • std version: 1.0.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions