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
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | const fc = require("fast-check");
|
---|
| 4 | const ByteBuffer_1 = require("./ByteBuffer");
|
---|
| 5 | const ZigZagEncoding_1 = require("./ZigZagEncoding");
|
---|
| 6 | const runFromStryker = __dirname.includes("stryker");
|
---|
| 7 | const runnerOptions = {
|
---|
| 8 | numRuns: runFromStryker ? 10 : 1000,
|
---|
| 9 | };
|
---|
| 10 | describe("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.