diff --git a/src/stream/DirectStream.ts b/src/stream/DirectStream.ts index aa22352..391d2f6 100644 --- a/src/stream/DirectStream.ts +++ b/src/stream/DirectStream.ts @@ -276,7 +276,11 @@ export default class DirectStream extends SafeEventEmitter (x instanceof Buffer ? Array.from(x.values()) : x))); } diff --git a/src/tests/stream/DirectStream.test.ts b/src/tests/stream/DirectStream.test.ts index 475b58d..d596fa2 100644 --- a/src/tests/stream/DirectStream.test.ts +++ b/src/tests/stream/DirectStream.test.ts @@ -319,4 +319,12 @@ describe("Stream", () => { ); // TODO: more? }); + + it("fails for unsupported read sizes", () => { + const stream = new DirectStream(); + + expect(() => stream.feed(Buffer.from([ControlCharacters.ReadGB]))).toThrow( + "Internal error: ReadGB, ReadTB, and ReadPB are not yet implemented." + ); + }); });