source: trip-planner-front/node_modules/hdr-histogram-js/dist/ZigZagEncoding.fc.spec.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 907 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const fc = require("fast-check");
4const ByteBuffer_1 = require("./ByteBuffer");
5const ZigZagEncoding_1 = require("./ZigZagEncoding");
6const runFromStryker = __dirname.includes("stryker");
7const runnerOptions = {
8 numRuns: runFromStryker ? 10 : 1000,
9};
10describe("Zig Zag Encoding", () => {
11 it("should get the same number after an encoding & decoding", () => {
12 const buffer = ByteBuffer_1.default.allocate(8);
13 fc.assert(fc.property(fc.nat(Number.MAX_SAFE_INTEGER), (number) => {
14 buffer.resetPosition();
15 ZigZagEncoding_1.default.encode(buffer, number);
16 buffer.resetPosition();
17 const result = ZigZagEncoding_1.default.decode(buffer);
18 return number === result;
19 }), runnerOptions);
20 });
21});
22//# sourceMappingURL=ZigZagEncoding.fc.spec.js.map
Note: See TracBrowser for help on using the repository browser.