diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-04-23 16:18:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 15:18:27 +0000 |
commit | b0d3b20f2319ad346fe70b1114f492f852689435 (patch) | |
tree | 913b962a727f8b9439a506a86150e5ee27417207 /tests/unit/esnext_test.ts | |
parent | 5236fd0dad3dd75ec1d650e74d36d4c6f1346e57 (diff) |
feat: enable Float16Array support (#23490)
Closes https://github.com/denoland/deno/issues/23450
Diffstat (limited to 'tests/unit/esnext_test.ts')
-rw-r--r-- | tests/unit/esnext_test.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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); +}); |