Description
Generate numeric spellings and malformed, overflow, and safe-integer controls with delegated number and integer parser outcomes.
A parser corpus pairs literal input spellings or structured documents with observable parser results or explicitly constructed expectations. Successful parsing, semantic validity, and exact round-trip preservation are separate properties, so test records retain the relevant evidence.
Generate numeric spellings and malformed, overflow, and safe-integer controls with delegated number and integer parser outcomes.
When to use this tool
Use this generator to create reproducible numeric parser boundary corpus cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply count, minimumInteger, maximumInteger in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read cases. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
For every sampled integer, create eight decimal, fractional, exponent, whitespace, malformed, overflow, and safe-integer-boundary strings. Run both localized number and integer parsers and retain success values or issue codes and fields.1
Delegated operations used for this result: number; integer. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 1; maximum 16. |
| minimumInteger | Minimum Integer | Required. Safe integer. |
| maximumInteger | Maximum Integer | Required. Safe integer. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| cases | Cases | Required. Array of Object; no unknown keys.; minimum items 8; maximum items 128. |
| cases[].kind | Kind | Required. Text; maximum UTF-16 length 4096. |
| cases[].text | Text | Required. Text; maximum UTF-16 length 4096. |
| cases[].format | Format | Required. Text; one of "plain", "en-US", "de-DE", "fr-FR". |
| cases[].number | Number | Required. Object; no unknown keys. |
| cases[].number.ok | Ok | Required. Boolean. |
| cases[].number.value | Value | Required. Finite number. or Null. |
| cases[].number.issueCodes | Issue Codes | Required. Array of Text; maximum UTF-16 length 4096.; minimum items 0; maximum items 128. |
| cases[].number.issueFields | Issue Fields | Required. Array of Text; maximum UTF-16 length 4096.; minimum items 0; maximum items 128. |
| cases[].integer | Integer | Required. Object; no unknown keys. |
| cases[].integer.ok | Ok | Required. Boolean. |
| cases[].integer.value | Value | Required. Finite number. or Null. |
| cases[].integer.issueCodes | Issue Codes | Required. Array of Text; maximum UTF-16 length 4096.; minimum items 0; maximum items 128. |
| cases[].integer.issueFields | Issue Fields | Required. Array of Text; maximum UTF-16 length 4096.; minimum items 0; maximum items 128. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"count": 1,
"minimumInteger": -20,
"maximumInteger": 20,
"seed": 42
},
"output": {
"cases": [
{
"kind": "integer",
"text": "4",
"format": "fr-FR",
"number": {
"ok": true,
"value": 4,
"issueCodes": [],
"issueFields": []
},
"integer": {
"ok": true,
"value": 4,
"issueCodes": [],
"issueFields": []
}
},
{
"kind": "fraction",
"text": "4,5",
"format": "fr-FR",
"number": {
"ok": true,
"value": 4.5,
"issueCodes": [],
"issueFields": []
},
"integer": {
"ok": false,
"value": null,
"issueCodes": [
"invalid_value"
],
"issueFields": [
"text"
]
}
},
{
"kind": "exponent",
"text": "4e2",
"format": "plain",
"number": {
"ok": true,
"value": 400,
"issueCodes": [],
"issueFields": []
},
"integer": {
"ok": true,
"value": 400,
"issueCodes": [],
"issueFields": []
}
},
{
"kind": "whitespace",
"text": " 4 ",
"format": "fr-FR",
"number": {
"ok": true,
"value": 4,
"issueCodes": [],
"issueFields": []
},
"integer": {
"ok": true,
"value": 4,
"issueCodes": [],
"issueFields": []
}
},
{
"kind": "malformed",
"text": "4x",
"format": "fr-FR",
"number": {
"ok": false,
"value": null,
"issueCodes": [
"invalid_value"
],
"issueFields": [
"text"
]
},
"integer": {
"ok": false,
"value": null,
"issueCodes": [
"invalid_value"
],
"issueFields": [
"text"
]
}
},
{
"kind": "overflow",
"text": "1e309",
"format": "plain",
"number": {
"ok": false,
"value": null,
"issueCodes": [
"invalid_value"
],
"issueFields": [
"text"
]
},
"integer": {
"ok": false,
"value": null,
"issueCodes": [
"invalid_value"
],
"issueFields": [
"text"
]
}
},
{
"kind": "safe-boundary",
"text": "9007199254740991",
"format": "plain",
"number": {
"ok": true,
"value": 9007199254740991,
"issueCodes": [],
"issueFields": []
},
"integer": {
"ok": true,
"value": 9007199254740991,
"issueCodes": [],
"issueFields": []
}
},
{
"kind": "unsafe-boundary",
"text": "9007199254740992",
"format": "plain",
"number": {
"ok": true,
"value": 9007199254740992,
"issueCodes": [],
"issueFields": []
},
"integer": {
"ok": false,
"value": null,
"issueCodes": [
"invalid_value"
],
"issueFields": [
"text"
]
}
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- count yields eight cases. Number acceptance and safe-integer acceptance differ, notably at 9007199254740992. These fixed controls test the named parsers rather than all locales or decimal spellings.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Spreadsheet Serial Date Boundary Corpus Generator
Sample integer serial dates around a caller boundary in the explicit 1900 or 1904 workbook system, retaining date-range and fictitious-day controls plus successful reverse conversions.
- Random Word Wrap Boundary Corpus Generator
Compose fresh ASCII word/separator sequences and inclusive line-width draws, then compare greedy wrapping with paragraph-aware justification. Whitespace and long-token boundaries are retained; wrap keeps overlong words while justification returns its actual structured rejection, using UTF-16/ASCII widths rather than display-column estimates.