feat(DataView, ConstDataView)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { ConstString, parse, serialize, sizeofHead } from "../src";
|
||||
import { filledDataView, sizedDataView } from ".";
|
||||
import { expectDataViewEqual, filledDataView, sizedDataView } from ".";
|
||||
|
||||
describe(ConstString.name, () => {
|
||||
test('serialize', () => {
|
||||
@ -11,14 +11,14 @@ describe(ConstString.name, () => {
|
||||
dv = sizedDataView(5)
|
||||
|
||||
serialize(dv, 'hello', ConstString(3))
|
||||
expect(dv).toEqual(expected)
|
||||
expectDataViewEqual(dv, expected)
|
||||
})
|
||||
|
||||
test('parse', () => {
|
||||
const expected = 'hel'
|
||||
const dv = filledDataView([0x68, 0x65, 0x6C, 0x6C, 0x6F])
|
||||
const actual = parse(dv, ConstString(3))
|
||||
expect(actual).toEqual(expected)
|
||||
expectDataViewEqual(actual, expected)
|
||||
})
|
||||
|
||||
test('sizeof', () => {
|
||||
|
||||
Reference in New Issue
Block a user