Skip to content

Commit

Permalink
✅ Cover even more arbitraries within Poisoning (#5673)
Browse files Browse the repository at this point in the history
**Description**

<!-- Please provide a short description and potentially linked issues
justifying the need for this PR -->

Some of our arbitraries used not to be covered by this E2E checking
resilience against external poisoning as they were depending on a
third-party that was not resilient. Now that we dropped the usage of the
part relying on non-resilient code we can extend our coverage for
Poisoning-resiliency to way more cases.

<!-- * Your PR is fixing a bug or regression? Check for existing issues
related to this bug and link them -->
<!-- * Your PR is adding a new feature? Make sure there is a related
issue or discussion attached to it -->

<!-- You can provide any additional context to help into understanding
what's this PR is attempting to solve: reproduction of a bug, code
snippets... -->

**Checklist** — _Don't delete this checklist and make sure you do the
following before opening the PR_

- [x] The name of my PR follows [gitmoji](https://gitmoji.dev/)
specification
- [x] My PR references one of several related issues (if any)
- [x] New features or breaking changes must come with an associated
Issue or Discussion
- [x] My PR does not add any new dependency without an associated Issue
or Discussion
- [x] My PR includes bumps details, please run `yarn bump` and flag the
impacts properly
- [x] My PR adds relevant tests and they would have failed without my PR
(when applicable)

<!-- More about contributing at
https://github.com/dubzzz/fast-check/blob/main/CONTRIBUTING.md -->

**Advanced**

<!-- How to fill the advanced section is detailed below! -->

- [x] Category: ✅ Add or update tests
- [x] Impacts: None
  • Loading branch information
dubzzz authored Feb 7, 2025
1 parent 41a6b51 commit 14f3221
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/fast-check/test/e2e/Poisoning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ describe(`Poisoning (seed: ${seed})`, () => {
{ name: 'maxSafeInteger', arbitraryBuilder: () => fc.maxSafeInteger() },
{ name: 'maxSafeNat', arbitraryBuilder: () => fc.maxSafeNat() },
{ name: 'float', arbitraryBuilder: () => fc.float() },
// pure-rand is not resilient to prototype poisoning occuring on Array
//{ name: 'double', arbitraryBuilder: () => fc.double() },
{ name: 'double', arbitraryBuilder: () => fc.double() },
{ name: 'bigInt', arbitraryBuilder: () => fc.bigInt() },
// String
// : Multiple characters
{ name: 'base64String', arbitraryBuilder: () => fc.base64String() },
{ name: 'string', arbitraryBuilder: () => fc.string() },
{ name: 'stringMatching', arbitraryBuilder: () => preBuiltStringMatching },
// : More specific strings
// related to fc.double: pure-rand is not resilient to prototype poisoning occuring on Array
//{ name: 'json', arbitraryBuilder: () => fc.json() },
{ name: 'json', arbitraryBuilder: () => fc.json() },
{ name: 'lorem', arbitraryBuilder: () => fc.lorem() },
{ name: 'ipV4', arbitraryBuilder: () => fc.ipV4() },
{ name: 'ipV4Extended', arbitraryBuilder: () => fc.ipV4Extended() },
Expand All @@ -70,8 +68,7 @@ describe(`Poisoning (seed: ${seed})`, () => {
{ name: 'int32Array', arbitraryBuilder: () => fc.int32Array() },
{ name: 'uint32Array', arbitraryBuilder: () => fc.uint32Array() },
{ name: 'float32Array', arbitraryBuilder: () => fc.float32Array() },
// related to fc.double: pure-rand is not resilient to prototype poisoning occuring on Array
//{ name: 'float64Array', arbitraryBuilder: () => fc.float64Array() },
{ name: 'float64Array', arbitraryBuilder: () => fc.float64Array() },
{ name: 'bigInt64Array', arbitraryBuilder: () => fc.bigInt64Array() },
{ name: 'bigUint64Array', arbitraryBuilder: () => fc.bigUint64Array() },
// Combinators
Expand All @@ -97,10 +94,9 @@ describe(`Poisoning (seed: ${seed})`, () => {
{ name: 'dictionary', arbitraryBuilder: () => fc.dictionary(basic().map(String), noop()) },
{ name: 'record', arbitraryBuilder: () => fc.record({ a: noop(), b: noop() }) },
{ name: 'record::requiredKeys', arbitraryBuilder: () => fc.record({ a: noop(), b: noop() }, { requiredKeys: [] }) },
// related to fc.double: pure-rand is not resilient to prototype poisoning occuring on Array
//{ name: 'object', arbitraryBuilder: () => fc.object() },
//{ name: 'jsonValue', arbitraryBuilder: () => fc.jsonValue() },
//{ name: 'anything', arbitraryBuilder: () => fc.anything() },
{ name: 'object', arbitraryBuilder: () => fc.object() },
{ name: 'jsonValue', arbitraryBuilder: () => fc.jsonValue() },
{ name: 'anything', arbitraryBuilder: () => fc.anything() },
// : Function
{ name: 'compareBooleanFunc', arbitraryBuilder: () => fc.compareBooleanFunc() },
{ name: 'compareFunc', arbitraryBuilder: () => fc.compareFunc() },
Expand Down

0 comments on commit 14f3221

Please sign in to comment.