Files
serialize-js/test/mem.test.js

19 lines
517 B
JavaScript

import { expect, test } from "vitest";
import { filledDataView, sizedDataView } from '../src'
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)
}
})