Skip to content

Commit 2b3a543

Browse files
wip
1 parent 0663b40 commit 2b3a543

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ts/src/decoding/integerStreamDecoder.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,15 @@ describe("decodeInt64Stream", () => {
665665
expect(result).toBe(0xffffffffffffffffn);
666666
});
667667

668+
it("should ZigZag-decode a single DELTA-encoded unsigned const Int64", () => {
669+
const metadata = createStreamMetadata(LogicalLevelTechnique.DELTA, LogicalLevelTechnique.NONE, 1);
670+
const data = encodeVarintInt64(new BigUint64Array([encodeZigZagInt64Value(4n)]));
671+
672+
const result = decodeUnsignedConstInt64Stream(data, new IntWrapper(0), metadata);
673+
674+
expect(result).toBe(4n);
675+
});
676+
668677
it("should decode NONE signed with all non-null values", () => {
669678
const metadata = createStreamMetadata(LogicalLevelTechnique.NONE);
670679
const expectedValues = new BigInt64Array([2n, -4n, 6n]);

0 commit comments

Comments
 (0)