From b0d3b20f2319ad346fe70b1114f492f852689435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 23 Apr 2024 16:18:27 +0100 Subject: feat: enable Float16Array support (#23490) Closes https://github.com/denoland/deno/issues/23450 --- tests/unit/esnext_test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/esnext_test.ts b/tests/unit/esnext_test.ts index cb40cc241..1d5759aaf 100644 --- a/tests/unit/esnext_test.ts +++ b/tests/unit/esnext_test.ts @@ -48,3 +48,12 @@ Deno.test(function setUnion() { const union = a.union(b); assertEquals(union, new Set([1, 2, 3, 4, 5])); }); + +Deno.test(function float16Array() { + const myNums = Float16Array.from([11.25, 2, -22.5, 1]); + const sorted = myNums.toSorted((a, b) => a - b); + assertEquals(sorted[0], -22.5); + assertEquals(sorted[1], 1); + assertEquals(sorted[2], 2); + assertEquals(sorted[3], 11.25); +}); -- cgit v1.2.3