Description
Compose nested var fallback expressions and literal bindings, then lower their acyclic fallback paths to the supported core resolver.
A protocol fixture is local test data representing headers, messages, identifiers, or request decisions. Serialization and parsing can be checked without contacting a server, while authentication, delivery, and actual client behavior require separate tests.
Compose nested var fallback expressions and literal bindings, then lower their acyclic fallback paths to the supported core resolver.
When to use this tool
Use this generator to create reproducible css custom property fallback 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, depth, literalTokens, bindingProbability 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. Keep answer-bearing fields separate when presenting an exercise.
Build nested fallback expressions over generated variable names and randomly supplied literal bindings. Serialize and parse declarations, translate the constructed chain into the linked fallback graph representation, and return its resolution evidence.1
Delegated operations used for this result: variable parser; variable fallback chain resolution. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| count | Count | Required. Safe integer; minimum 1; maximum 32. |
| depth | Depth | Required. Object; no unknown keys. |
| depth.minimum | Minimum | Required. Safe integer; minimum 1; maximum 8. |
| depth.maximum | Maximum | Required. Safe integer; minimum 1; maximum 8. |
| literalTokens | Literal Tokens | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 128.; minimum items 1; maximum items 32. |
| bindingProbability | Binding Probability | Required. Finite number; minimum 0; maximum 1. |
| 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 1; maximum items 32. |
| cases[].expression | Expression | Required. Text; maximum UTF-16 length 2048. |
| cases[].declarations | Declarations | Required. Text; maximum UTF-16 length 2048. |
| cases[].parsedBindings | Parsed Bindings | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 8. |
| cases[].parsedBindings[].name | Name | Required. Text. |
| cases[].parsedBindings[].value | Value | Required. Text. |
| cases[].normalizedGraph | Normalized Graph | Required. Object; no unknown keys. |
| cases[].normalizedGraph.variableNames | Variable Names | Required. Array of Text; maximum UTF-16 length 128.; minimum items 0; maximum items 8. |
| cases[].normalizedGraph.literalTokens | Literal Tokens | Required. Array of Text; maximum UTF-16 length 128.; minimum items 0; maximum items 8. |
| cases[].normalizedGraph.referencedVariables | Referenced Variables | Required. Array of Text; maximum UTF-16 length 128.; minimum items 0; maximum items 8. |
| cases[].normalizedGraph.fallbackTokens | Fallback Tokens | Required. Array of Text; maximum UTF-16 length 128.; minimum items 0; maximum items 8. |
| cases[].normalizedGraph.queryVariable | Query Variable | Required. Text. |
| cases[].resolvedToken | Resolved Token | Required. Text; maximum UTF-16 length 128. |
| cases[].visitedVariables | Visited Variables | Required. Array of Text; maximum UTF-16 length 128.; minimum items 0; maximum items 8. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer 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": 2,
"depth": {
"minimum": 3,
"maximum": 3
},
"literalTokens": [
"red",
"blue",
"green"
],
"bindingProbability": 0.5,
"seed": 42
},
"output": {
"cases": [
{
"expression": "var(--v0, var(--v1, var(--v2, red)))",
"declarations": "--v0: green; --v2: blue;",
"parsedBindings": [
{
"name": "--v0",
"value": "green"
},
{
"name": "--v2",
"value": "blue"
}
],
"normalizedGraph": {
"variableNames": [
"--v0",
"--v1",
"--v2"
],
"literalTokens": [
"green",
"",
"blue"
],
"referencedVariables": [
"",
"--v2",
""
],
"fallbackTokens": [
"",
"",
""
],
"queryVariable": "--v0"
},
"resolvedToken": "green",
"visitedVariables": [
"--v0"
]
},
{
"expression": "var(--v0, var(--v1, var(--v2, green)))",
"declarations": "--v1: red;",
"parsedBindings": [
{
"name": "--v1",
"value": "red"
}
],
"normalizedGraph": {
"variableNames": [
"--v0",
"--v1",
"--v2"
],
"literalTokens": [
"",
"red",
"green"
],
"referencedVariables": [
"--v1",
"",
""
],
"fallbackTokens": [
"",
"",
""
],
"queryVariable": "--v0"
},
"resolvedToken": "red",
"visitedVariables": [
"--v0",
"--v1"
]
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- This tests an explicitly constructed chain, not parsing arbitrary var expressions or evaluating the full CSS cascade. Literal bindings are trimmed tokens and no stylesheet is applied to a DOM.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- 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 Custom Element Name Fixture Generator
Construct names from caller-supplied ASCII parts and controlled dash-removal, uppercase and reserved-name mutations, retaining current core flags without registering elements.
- Random Barcode Label Sheet Generator
Generate seeded synthetic EAN-13 or UPC-A data under an optional digit prefix, delegate check digits and SVG symbols, and return bounded zero-based label-grid positions for an app-rendered sheet; optional uniqueness applies to identifiers, while assignment, physical scanner readiness, print layout and export are not claimed.