feat(serialize, parse): Number, String, Array, ConstString, ConstArray
This commit is contained in:
18
test/mem.test.js
Normal file
18
test/mem.test.js
Normal file
@ -0,0 +1,18 @@
|
||||
import { expect, test } from "vitest";
|
||||
import { filledDataView, sizedDataView } from ".";
|
||||
import { memcpy } from "../src";
|
||||
|
||||
test('memcpy', () => {
|
||||
{
|
||||
const dest = sizedDataView(9)
|
||||
const src = filledDataView([0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])
|
||||
memcpy(dest, src)
|
||||
expect(dest).toEqual(src)
|
||||
}
|
||||
{
|
||||
const dest = sizedDataView(10)
|
||||
const src = filledDataView([0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])
|
||||
memcpy(dest, src)
|
||||
expect(dest).toEqual(src)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user