19 lines
513 B
JavaScript
19 lines
513 B
JavaScript
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)
|
|
}
|
|
})
|