mirror of
https://github.com/cupcakearmy/occulto.git
synced 2026-04-02 22:05:28 +00:00
add tests for binary
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
import { Base64, Bytes, Hex } from '../dist/index.js'
|
||||
import { compareArrayLike } from './utils.js'
|
||||
import { Precomputed } from './values.js'
|
||||
|
||||
describe('Encoding', () => {
|
||||
describe('Bytes', () => {
|
||||
for (const [input, output] of Object.entries(Precomputed.Encoding.Bytes)) {
|
||||
it(`Should encode ${input} to ${output}`, async () => {
|
||||
compareArrayLike(Bytes.encode(input), output)
|
||||
})
|
||||
it(`Should decode ${output} to ${input}`, async () => {
|
||||
compareArrayLike(await Bytes.decode(output), input)
|
||||
})
|
||||
}
|
||||
})
|
||||
describe('Hex', () => {
|
||||
for (const [input, output] of Object.entries(Precomputed.Encoding.Hex)) {
|
||||
const buffer = Bytes.encode(input)
|
||||
|
||||
Reference in New Issue
Block a user