-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(uint32ArrayFrom): increment index & polyfill for Uint32Array (#270)
increment index and polyfill for Uint32Array instead of Array
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { expect } from "chai"; | ||
import "mocha"; | ||
import { uint32ArrayFrom } from "../src/uint32ArrayFrom"; | ||
|
||
describe("uint32ArrayFrom", () =>{ | ||
it("When given an empty array, should return an empty array", () => { | ||
expect(uint32ArrayFrom(Array.of(0))) | ||
.to | ||
.eql(Uint32Array.of(0)) | ||
}) | ||
|
||
it("Given a populated array, returns a valid Uint32 Array", () => { | ||
expect(uint32ArrayFrom(Array.of(0x00000000, 0xF26B8303, 0xE13B70F7))) | ||
.to | ||
.eql(Uint32Array.of(0, 4067132163, 3778769143)) | ||
}) | ||
}) |