Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ’₯ Drop deprecated ascii* #5636

Merged
merged 4 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilly-bikes-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fast-check": major
---

πŸ’₯ Drop deprecated `ascii*` (#5280)
13 changes: 0 additions & 13 deletions packages/fast-check/src/arbitrary/ascii.ts

This file was deleted.

29 changes: 0 additions & 29 deletions packages/fast-check/src/arbitrary/asciiString.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/fast-check/src/fast-check-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { bigUintN } from './arbitrary/bigUintN';
import { boolean } from './arbitrary/boolean';
import type { FalsyContraints, FalsyValue } from './arbitrary/falsy';
import { falsy } from './arbitrary/falsy';
import { ascii } from './arbitrary/ascii';
import { base64 } from './arbitrary/base64';
import { char } from './arbitrary/char';
import { char16bits } from './arbitrary/char16bits';
Expand Down Expand Up @@ -107,7 +106,6 @@ import type {
} from './arbitrary/uniqueArray';
import { uniqueArray } from './arbitrary/uniqueArray';
import { infiniteStream } from './arbitrary/infiniteStream';
import { asciiString } from './arbitrary/asciiString';
import { base64String } from './arbitrary/base64String';
import { fullUnicodeString } from './arbitrary/fullUnicodeString';
import { hexaString } from './arbitrary/hexaString';
Expand Down Expand Up @@ -361,15 +359,13 @@ export {
bigInt,
bigUint,
char,
ascii,
char16bits,
unicode,
fullUnicode,
hexa,
base64,
mixedCase,
string,
asciiString,
string16bits,
stringOf,
unicodeString,
Expand Down
3 changes: 0 additions & 3 deletions packages/fast-check/test/e2e/GenerateAllValues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ describe(`Generate all values (seed: ${seed})`, () => {
describe('fc.char()', () => {
it('Should be able to produce any printable character', () => lookForMissing(fc.char(), 95));
});
describe('fc.ascii()', () => {
it('Should be able to produce any character from ascii', () => lookForMissing(fc.ascii(), 128));
});
describe('fc.char16bits()', () => {
it('Should be able to produce any 16 bits character', () => lookForMissing(fc.char16bits(), 65536));
});
Expand Down
10 changes: 0 additions & 10 deletions packages/fast-check/test/e2e/NoRegression.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@ describe(`NoRegression`, () => {
),
).toThrowErrorMatchingSnapshot();
});
it('asciiString', () => {
expect(
runWithSanitizedStack(() =>
fc.assert(
fc.property(fc.asciiString(), (v) => testFunc(v)),
settings,
),
),
).toThrowErrorMatchingSnapshot();
});
// // Jest Snapshot seems not to support incomplete surrogate pair correctly
// it('string16bits', () => {
// expect(runWithSanitizedStack(() => fc.assert(fc.property(fc.string16bits(), v => testFunc(v + v)), settings))).toThrowErrorMatchingSnapshot();
Expand Down
2 changes: 0 additions & 2 deletions packages/fast-check/test/e2e/Poisoning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ describe(`Poisoning (seed: ${seed})`, () => {
{ name: 'hexa', arbitraryBuilder: () => fc.hexa() },
{ name: 'base64', arbitraryBuilder: () => fc.base64() },
{ name: 'char', arbitraryBuilder: () => fc.char() },
{ name: 'ascii', arbitraryBuilder: () => fc.ascii() },
{ name: 'unicode', arbitraryBuilder: () => fc.unicode() },
{ name: 'char16bits', arbitraryBuilder: () => fc.char16bits() },
{ name: 'fullUnicode', arbitraryBuilder: () => fc.fullUnicode() },
// : Multiple characters
{ name: 'hexaString', arbitraryBuilder: () => fc.hexaString() },
{ name: 'base64String', arbitraryBuilder: () => fc.base64String() },
{ name: 'string', arbitraryBuilder: () => fc.string() },
{ name: 'asciiString', arbitraryBuilder: () => fc.asciiString() },
{ name: 'unicodeString', arbitraryBuilder: () => fc.unicodeString() },
{ name: 'string16bits', arbitraryBuilder: () => fc.string16bits() },
{ name: 'fullUnicodeString', arbitraryBuilder: () => fc.fullUnicodeString() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1473,37 +1473,6 @@ Execution summary:
. . . . . . . . . . . . . . . . . . . √ [[53219898]]]
`;

exports[`NoRegression > asciiString 1`] = `
[Error: Property failed after 2 tests
{ seed: 42, path: "1:1:1:4:1:1:1:2", endOnFailure: true }
Counterexample: ["\\u0000"]
Shrunk 7 time(s)

Execution summary:
√ [""]
Γ— ["zWiHt\\u001d(t"]
. √ [""]
. Γ— ["t\\u001d(t"]
. . √ ["(t"]
. . Γ— ["\\u001d(t"]
. . . √ ["(t"]
. . . √ [" (t"]
. . . √ ["^(t"]
. . . √ ["}(t"]
. . . Γ— ["\\u000e(t"]
. . . . √ ["(t"]
. . . . Γ— ["\\u0006(t"]
. . . . . √ ["(t"]
. . . . . Γ— ["\\u0002(t"]
. . . . . . √ ["(t"]
. . . . . . Γ— ["\\u0000(t"]
. . . . . . . √ ["(t"]
. . . . . . . √ ["~(t"]
. . . . . . . Γ— ["\\u0000"]
. . . . . . . . √ [""]
. . . . . . . . √ ["~"]]
`;

exports[`NoRegression > base64String 1`] = `
[Error: Property failed after 3 tests
{ seed: 42, path: "2:3:5:5", endOnFailure: true }
Expand Down
94 changes: 0 additions & 94 deletions packages/fast-check/test/unit/arbitrary/ascii.spec.ts

This file was deleted.

51 changes: 0 additions & 51 deletions packages/fast-check/test/unit/arbitrary/asciiString.spec.ts

This file was deleted.

18 changes: 0 additions & 18 deletions website/docs/core-blocks/arbitraries/primitives/char.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ fc.char();
Resources: [API reference](https://fast-check.dev/api-reference/functions/char.html).
Available since 0.0.1.

## ascii

One ascii character β€” _ie.: one character between `0x00` (included) and `0x7f` (included)_.

**Signatures:**

- `fc.ascii()` β€” _deprecated since v3.22.0, prefer [string](https://fast-check.dev/docs/core-blocks/arbitraries/primitives/string/#string-1) (more details at [#5233](https://github.com/dubzzz/fast-check/pull/5233))_

**Usages:**

```js
fc.ascii();
// Examples of generated values: "4", "l", "S", ";", "\u0019"…
```

Resources: [API reference](https://fast-check.dev/api-reference/functions/ascii.html).
Available since 0.0.1.

## unicode

One unicode character from BMP-plan β€” _ie.: one character between `0x0000` (included) and `0xffff` (included) but excluding surrogate pairs (between `0xd800` and `0xdfff`)_.
Expand Down
37 changes: 0 additions & 37 deletions website/docs/core-blocks/arbitraries/primitives/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,43 +117,6 @@ fc.string({ unit: fc.constantFrom('Hello', 'World') });
Resources: [API reference](https://fast-check.dev/api-reference/functions/string.html).
Available since 0.0.1.

## asciiString

ASCII string containing characters produced by `fc.ascii()`.

**Signatures:**

- `fc.asciiString()` β€” _deprecated since v3.22.0, prefer [string](https://fast-check.dev/docs/core-blocks/arbitraries/primitives/string/#string-1) (more details at [#5233](https://github.com/dubzzz/fast-check/pull/5233))_
- `fc.asciiString({minLength?, maxLength?, size?})` β€” _deprecated since v3.22.0, prefer [string](https://fast-check.dev/docs/core-blocks/arbitraries/primitives/string/#string-1) (more details at [#5233](https://github.com/dubzzz/fast-check/pull/5233))_

**with:**

- `minLength?` β€” default: `0` β€” _minimal number of characters (included)_
- `maxLength?` β€” default: `0x7fffffff` [more](/docs/configuration/larger-entries-by-default/#size-explained) β€” _maximal number of characters (included)_
- `size?` β€” default: `undefined` [more](/docs/configuration/larger-entries-by-default/#size-explained) β€” _how large should the generated values be?_

**Usages:**

```js
fc.asciiString();
// Examples of generated values: "\f@D", "hp", "q#dO~?@", "Qad", "5eHqc"…

fc.asciiString({ maxLength: 3 });
// Note: Any ascii string containing up to 3 (included) characters
// Examples of generated values: "6", "", "ty", ",", "k"…

fc.asciiString({ minLength: 3 });
// Note: Any ascii string containing at least 3 (included) characters
// Examples of generated values: "603e", "6W\u001b^tR-\n\n|", "efproto_\u001abhasOw", "$\u001c&\u0000R", "apply"…

fc.asciiString({ minLength: 4, maxLength: 6 });
// Note: Any ascii string containing between 4 (included) and 6 (included) characters
// Examples of generated values: "<&\u001e\u001b ", "bind", "dnGn\\2", "& % !", "__defi"…
```

Resources: [API reference](https://fast-check.dev/api-reference/functions/asciiString.html).
Available since 0.0.1.

## unicodeString

Unicode string containing characters produced by `fc.unicode()`.
Expand Down
Loading
Loading