Align NaCl functions with Rust tests (#72)
* Align nacl functions with Rust tests * Match tests from Rust
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// Copyright 2017-2018 Jaco Greeff
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
|
||||
const { u8aFromString } = require('./index');
|
||||
|
||||
describe('u8aFromString', () => {
|
||||
it('encodes a string byte for byte', () => {
|
||||
expect(
|
||||
u8aFromString('12345678901234567890123456789012')
|
||||
).toEqual(
|
||||
new Uint8Array([
|
||||
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
|
||||
0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
|
||||
0x37, 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34,
|
||||
0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x31, 0x32
|
||||
])
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user