UNPKG

@foxglove/ros1

Version:

Standalone TypeScript implementation of the ROS 1 (Robot Operating System) protocol with a pluggable transport layer

20 lines (18 loc) 617 B
import { concatData } from "./concatData"; describe("concatData", () => { it("concatData works", () => { expect(concatData([])).toEqual(new Uint8Array()); expect(concatData([new Uint8Array([1, 2, 3])])).toEqual(new Uint8Array([1, 2, 3])); expect(concatData([new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6])])).toEqual( new Uint8Array([1, 2, 3, 4, 5, 6]), ); expect( concatData([ new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]), new Uint8Array(), new Uint8Array([7]), ]), ).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6, 7])); }); });