Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash: add Float16Array to assert tests
  • Loading branch information
LiviaMedeiros committed Apr 17, 2025
commit 64c61038b331fcc04ec7eeceed7494a71c71bdaf
7 changes: 7 additions & 0 deletions test/parallel/test-assert-partial-deep-equal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Flags: --js-float16array
// TODO(LiviaMedeiros): once `Float16Array` is unflagged in v8, remove the line above
'use strict';

const common = require('../common');
Expand Down Expand Up @@ -494,6 +496,11 @@ describe('Object Comparison Tests', () => {
actual: { dataView: new Uint8Array(3) },
expected: { dataView: new DataView(new ArrayBuffer(3)) },
},
{
description: 'throws when comparing Float16Array([+0.0]) with Float16Array([-0.0])',
actual: new Float16Array([+0.0]),
expected: new Float16Array([-0.0]),
},
{
description: 'throws when comparing Float32Array([+0.0]) with Float32Array([-0.0])',
actual: new Float32Array([+0.0]),
Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-assert-typedarray-deepequal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Flags: --js-float16array
// TODO(LiviaMedeiros): once `Float16Array` is unflagged in v8, remove the line above
'use strict';

require('../common');
Expand All @@ -20,6 +22,7 @@ suite('equalArrayPairs', () => {
[new Int8Array(1e5), new Int8Array(1e5)],
[new Int16Array(1e5), new Int16Array(1e5)],
[new Int32Array(1e5), new Int32Array(1e5)],
[new Float16Array(1e5), new Float16Array(1e5)],
[new Float32Array(1e5), new Float32Array(1e5)],
[new Float64Array(1e5), new Float64Array(1e5)],
[new Float32Array([+0.0]), new Float32Array([+0.0])],
Expand All @@ -41,6 +44,7 @@ suite('equalArrayPairs', () => {

suite('looseEqualArrayPairs', () => {
const looseEqualArrayPairs = [
[new Float16Array([+0.0]), new Float16Array([-0.0])],
[new Float32Array([+0.0]), new Float32Array([-0.0])],
[new Float64Array([+0.0]), new Float64Array([-0.0])],
];
Expand Down Expand Up @@ -71,6 +75,8 @@ suite('notEqualArrayPairs', () => {
[new Int16Array([0]), new Uint16Array([256])],
[new Int16Array([-256]), new Uint16Array([0xff00])], // same bits
[new Int32Array([-256]), new Uint32Array([0xffffff00])], // ditto
[new Float16Array([Number.EPSILON]), new Float16Array([0.0])],
[new Float16Array([0.1]), new Float16Array([0.1, 0.2])],
[new Float32Array([0.1]), new Float32Array([0.0])],
[new Float32Array([0.1]), new Float32Array([0.1, 0.2])],
[new Float64Array([0.1]), new Float64Array([0.0])],
Expand Down