feat(struct): new API full rewrite

This commit is contained in:
Simon Chan 2024-10-31 17:26:37 +08:00
parent a29268426d
commit d50a170ab8
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
89 changed files with 1487 additions and 5512 deletions

View file

@ -51,6 +51,18 @@ async function assertResolves<T>(promise: Promise<T>, expected: T) {
return assert.deepStrictEqual(await promise, expected);
}
describe("AdbShellProtocolPacket", () => {
it("should serialize", () => {
assert.deepStrictEqual(
AdbShellProtocolPacket.serialize({
id: AdbShellProtocolId.Stdout,
data: new Uint8Array([1, 2, 3, 4]),
}),
new Uint8Array([1, 4, 0, 0, 0, 1, 2, 3, 4]),
);
});
});
describe("AdbSubprocessShellProtocol", () => {
describe("`stdout` and `stderr`", () => {
it("should parse data from `socket", () => {