fast-check
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,2 +8,3 @@ import Random from '../../random/generator/Random'; | ||
readonly minLength: number; | ||
readonly maxLength: number; | ||
readonly preFilter: (tab: Shrinkable<T>[]) => Shrinkable<T>[]; | ||
@@ -10,0 +11,0 @@ readonly lengthArb: ArbitraryWithShrink<number>; |
@@ -44,2 +44,3 @@ "use strict"; | ||
_this.minLength = minLength; | ||
_this.maxLength = maxLength; | ||
_this.preFilter = preFilter; | ||
@@ -72,5 +73,7 @@ _this.lengthArb = IntegerArbitrary_1.integer(minLength, maxLength); | ||
.join(items[0].shrink().map(function (v) { return [v].concat(items.slice(1)); })) | ||
.join(this.shrinkImpl(items.slice(1), false) | ||
.filter(function (vs) { return _this.minLength <= vs.length + 1; }) | ||
.map(function (vs) { return [items[0]].concat(vs); })); | ||
.join(items.length > this.minLength | ||
? this.shrinkImpl(items.slice(1), false) | ||
.filter(function (vs) { return _this.minLength <= vs.length + 1; }) | ||
.map(function (vs) { return [items[0]].concat(vs); }) | ||
: Stream_1.Stream.nil()); | ||
}; | ||
@@ -77,0 +80,0 @@ return ArrayArbitrary; |
{ | ||
"name": "fast-check", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Property based testing framework in TypeScript (like QuickCheck)", | ||
@@ -5,0 +5,0 @@ "main": "lib/fast-check.js", |
@@ -42,2 +42,13 @@ # Fast Check | ||
If you want to synchronize and build the code locally: | ||
```bash | ||
git clone https://github.com/dubzzz/fast-check.git && cd fast-check | ||
npm install | ||
npm run prebuild #generate missing implementations: tuple and properties | ||
npm run build #compile the code in ./src, build the ./lib content | ||
npm run test #run unit tests | ||
npm run e2e #run end-to-end tests: check the code can shrink on errors, replay on failure... | ||
``` | ||
## Usage | ||
@@ -44,0 +55,0 @@ |
@@ -13,3 +13,3 @@ import Random from '../../random/generator/Random'; | ||
readonly minLength: number, | ||
maxLength: number, | ||
readonly maxLength: number, | ||
readonly preFilter: (tab: Shrinkable<T>[]) => Shrinkable<T>[] = tab => tab | ||
@@ -43,5 +43,7 @@ ) { | ||
.join( | ||
this.shrinkImpl(items.slice(1), false) | ||
.filter(vs => this.minLength <= vs.length + 1) | ||
.map(vs => [items[0]].concat(vs)) | ||
items.length > this.minLength | ||
? this.shrinkImpl(items.slice(1), false) | ||
.filter(vs => this.minLength <= vs.length + 1) | ||
.map(vs => [items[0]].concat(vs)) | ||
: Stream.nil<Shrinkable<T>[]>() | ||
); | ||
@@ -48,0 +50,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
650083
167
10358
403