fast-check
Advanced tools
Comparing version 3.6.0 to 3.6.1
@@ -0,1 +1,10 @@ | ||
# 3.6.1 | ||
_Some more performance improvements_ | ||
[[Code](https://github.com/dubzzz/fast-check/tree/v3.6.1)][[Diff](https://github.com/dubzzz/fast-check/compare/v3.6.0...v3.6.1)] | ||
## Fixes | ||
- ([PR#3563](https://github.com/dubzzz/fast-check/pull/3563)) Performance: Mutate rng inplace in tosser | ||
# 3.6.0 | ||
@@ -2,0 +11,0 @@ |
@@ -63,2 +63,11 @@ "use strict"; | ||
exports.QualifiedParameters = QualifiedParameters; | ||
QualifiedParameters.createQualifiedRandomGenerator = (random) => { | ||
return (seed) => { | ||
const rng = random(seed); | ||
if (rng.unsafeJump === undefined) { | ||
rng.unsafeJump = () => (0, pure_rand_1.unsafeSkipN)(rng, 42); | ||
} | ||
return rng; | ||
}; | ||
}; | ||
QualifiedParameters.readSeed = (p) => { | ||
@@ -79,6 +88,6 @@ if (p.seed == null) | ||
case 'mersenne': | ||
return pure_rand_1.default.mersenne; | ||
return QualifiedParameters.createQualifiedRandomGenerator(pure_rand_1.default.mersenne); | ||
case 'congruential': | ||
case 'congruential32': | ||
return pure_rand_1.default.congruential32; | ||
return QualifiedParameters.createQualifiedRandomGenerator(pure_rand_1.default.congruential32); | ||
case 'xorshift128plus': | ||
@@ -99,3 +108,6 @@ return pure_rand_1.default.xorshift128plus; | ||
} | ||
return p.randomType; | ||
if ('unsafeJump' in mrng) { | ||
return p.randomType; | ||
} | ||
return QualifiedParameters.createQualifiedRandomGenerator(p.randomType); | ||
}; | ||
@@ -102,0 +114,0 @@ QualifiedParameters.readNumRuns = (p) => { |
@@ -11,5 +11,5 @@ "use strict"; | ||
let idx = 0; | ||
let rng = random(seed); | ||
const rng = random(seed); | ||
for (;;) { | ||
rng = rng.jump ? rng.jump() : (0, pure_rand_1.skipN)(rng, 42); | ||
rng.unsafeJump(); | ||
yield generator.generate(new Random_1.Random(rng), idx++); | ||
@@ -16,0 +16,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import prand from 'pure-rand'; | ||
import prand, { unsafeSkipN } from 'pure-rand'; | ||
import { VerbosityLevel } from './VerbosityLevel.js'; | ||
@@ -59,2 +59,11 @@ const safeDateNow = Date.now; | ||
} | ||
QualifiedParameters.createQualifiedRandomGenerator = (random) => { | ||
return (seed) => { | ||
const rng = random(seed); | ||
if (rng.unsafeJump === undefined) { | ||
rng.unsafeJump = () => unsafeSkipN(rng, 42); | ||
} | ||
return rng; | ||
}; | ||
}; | ||
QualifiedParameters.readSeed = (p) => { | ||
@@ -75,6 +84,6 @@ if (p.seed == null) | ||
case 'mersenne': | ||
return prand.mersenne; | ||
return QualifiedParameters.createQualifiedRandomGenerator(prand.mersenne); | ||
case 'congruential': | ||
case 'congruential32': | ||
return prand.congruential32; | ||
return QualifiedParameters.createQualifiedRandomGenerator(prand.congruential32); | ||
case 'xorshift128plus': | ||
@@ -95,3 +104,6 @@ return prand.xorshift128plus; | ||
} | ||
return p.randomType; | ||
if ('unsafeJump' in mrng) { | ||
return p.randomType; | ||
} | ||
return QualifiedParameters.createQualifiedRandomGenerator(p.randomType); | ||
}; | ||
@@ -98,0 +110,0 @@ QualifiedParameters.readNumRuns = (p) => { |
@@ -8,5 +8,5 @@ import { skipN } from 'pure-rand'; | ||
let idx = 0; | ||
let rng = random(seed); | ||
const rng = random(seed); | ||
for (;;) { | ||
rng = rng.jump ? rng.jump() : skipN(rng, 42); | ||
rng.unsafeJump(); | ||
yield generator.generate(new Random(rng), idx++); | ||
@@ -13,0 +13,0 @@ } |
@@ -104,4 +104,4 @@ import { pre } from './check/precondition/Pre.js'; | ||
const __type = 'module'; | ||
const __version = '3.6.0'; | ||
const __commitHash = '29e9903b15cecb0415cc1d41dd2dd482d4a7e42e'; | ||
const __version = '3.6.1'; | ||
const __commitHash = '6841f98c90165dac5921f1a3bbbe678b138d1200'; | ||
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, asyncModelRun, modelRun, scheduledModelRun, commands, scheduler, schedulerFor, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, toStringMethod, hasToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, Random, Stream, stream, createDepthIdentifier, }; |
@@ -229,5 +229,5 @@ "use strict"; | ||
exports.__type = __type; | ||
const __version = '3.6.0'; | ||
const __version = '3.6.1'; | ||
exports.__version = __version; | ||
const __commitHash = '29e9903b15cecb0415cc1d41dd2dd482d4a7e42e'; | ||
const __commitHash = '6841f98c90165dac5921f1a3bbbe678b138d1200'; | ||
exports.__commitHash = __commitHash; |
@@ -120,3 +120,3 @@ import { pre } from './check/precondition/Pre'; | ||
/** | ||
* Version of fast-check used by your project (eg.: 3.6.0) | ||
* Version of fast-check used by your project (eg.: 3.6.1) | ||
* @remarks Since 1.22.0 | ||
@@ -127,3 +127,3 @@ * @public | ||
/** | ||
* Commit hash of the current code (eg.: 29e9903b15cecb0415cc1d41dd2dd482d4a7e42e) | ||
* Commit hash of the current code (eg.: 6841f98c90165dac5921f1a3bbbe678b138d1200) | ||
* @remarks Since 2.7.0 | ||
@@ -130,0 +130,0 @@ * @public |
{ | ||
"name": "fast-check", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "Property based testing framework for JavaScript (like QuickCheck)", | ||
@@ -60,4 +60,4 @@ "type": "commonjs", | ||
"@fast-check/poisoning": "0.0.5", | ||
"@microsoft/api-extractor": "^7.33.7", | ||
"@types/jest": "^29.2.5", | ||
"@microsoft/api-extractor": "^7.33.8", | ||
"@types/jest": "^29.2.6", | ||
"@types/node": "^18.11.18", | ||
@@ -64,0 +64,0 @@ "buffer": "^6.0.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
882070
19902