Commit Graph

23 Commits

Author SHA1 Message Date
lilleman 91cbae2a44 Tests for the shipped data layer, New options and concurrent Fake 2026-09-01 23:05:58 +02:00
lilleman 04b7b6a432 Rename the exported type to Generator and retire the faker wording
Tests / vet + fmt + tests (pull_request) Successful in 25s
2026-09-01 21:34:27 +02:00
lilleman 05dc042e49 Rename the project to fejkdata and record the fork source
Tests / vet + fmt + tests (pull_request) Failing after 6s
2026-09-01 20:24:03 +02:00
M 64a0d29496 Say why an empty name is rejected, and finish what that removed
Tests / vet + fmt + tests (push) Failing after 42s
The reason given was wrong. A dot path did reach an empty-named field:
Fake("a.") returned it, Fake("a.b.") returned a nested one, and {..a.} bound
it. What was true is narrower — List never offered it, because an empty name
is no path segment — so the engine accepted spellings it would not advertise.
The message, the test comment and the README say that instead.

Two things the rejection finished off:

A {} token still reported "no field \"\"", pointing at a fix the loader now
rejects — two errors for one rule. It is told the name can never exist, like
an option token already is.

addressable is dead: both halves of "not empty and no dot" are now rejected
where a name is authored. Mutating it to panic leaves the suite green here
and panics on main, so it was live and is not. Keeping it would preserve the
silent-hiding this change removes — List quietly omitting a name rather than
New refusing it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-01 07:31:18 +02:00
M e31e77b8a3 Tests for an empty field name
A field named "" loads, and a bare {} token renders it, but no dot path can
reach it — List hides it and Fake cannot ask for it. {a.} is already rejected
for the same reason, so the two spellings disagree about the same mistake.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-01 07:31:18 +02:00
M 779b89a804 Tests for what an operand's draw actually fixes
Widening the fence used containment for both kinds of hold, which is right
for a level a path reads and wrong for a sibling a calc reads. A path may
read into anything the level contains; an operand's draw fixes only the value
it renders. So containment rejects a reference to a sibling the operand never
renders, which loads fine today and cannot disagree, and misses a reference
reaching what the operand renders through, which disagreed in 20 of 40 draws.

Also pins the repeated reference arm, the one kind that reaches the repeat
check by passing the per-arm checks rather than falling through them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M dea1fcf311 Tests for an arm check that yields to a clearer error
{..|..} reported a repeated arm rather than a reference with no path, and
{|} reported one rather than a missing field. Both are load errors either
way, but the repeat is a consequence of the real mistake, so the real one
should be what the author reads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M cc76d300e7 Tests for a repeated alternation arm
{a|a|b} skews an alternation three to one, an undocumented third way to
weight beside a choice's weight and a repeated choice entry. These pin its
rejection, and one accepted case fixes the boundary: {x}{x} is two tokens,
so it stays two independent draws.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 13:33:05 +02:00
M cc8f8db83f Tests for a name no token can spell
A dot is already rejected in a category, folder or field name. The token
grammar reserves three more characters: '|' separates a token's arms, '('
opens a function call, and '}' ends the token. A name carrying one resolves
by dot path and is advertised by List, yet no format can name it.

These pin the rejection, and one accepted case fixes the boundary: ')' on
its own is spellable, so it stays legal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 13:33:05 +02:00
M 12100239f5 Draw a dotted token's head once per expansion 2026-08-30 22:31:54 +02:00
M 5263c866c4 Tests for a dotted sibling token drawing its head once per expansion 2026-08-30 22:31:54 +02:00
M 16f91503b0 Reject a standalone weight on key presence, whatever its value 2026-08-28 13:27:32 +02:00
M 48cadd6c4d Tests that a standalone weight of any type is rejected 2026-08-28 13:27:32 +02:00
M 8d0393713c Tests for options that cannot take effect, and entries that are not data 2026-08-28 13:27:32 +02:00
Mikael Göransson e73cb398ac Keep every legal compound surname reachable, and tighten the README wording 2026-08-28 13:24:07 +02:00
Mikael Göransson 362c484825 Advertise only spellable paths, and name what a choice's variants share 2026-08-28 13:15:14 +02:00
Mikael Göransson 595809bf38 Tests for an ambiguous dot-path key and for naming a missing field 2026-08-28 13:15:14 +02:00
Mikael Göransson 1665b37cad Precompute each choice's shared paths so a dotted path stays O(1) 2026-08-28 13:15:14 +02:00
lilleman 7d5d03e393 Tests for the every-arm rule on paths through a choice, and the List/Fake contract 2026-08-28 13:15:14 +02:00
lilleman 8db65ac598 Replace locale dirs with a data-folder namespace model: New([]paths), folder dot-paths, last-wins merge 2026-06-08 23:52:37 +02:00
lilleman 3e1cd3ee2a Add repeat/separator templates; validate at compile time; support Go 1.22+ via GO_VERSION 2026-06-08 21:11:58 +02:00
lilleman e28b92090d Expand locale data sets; match tests against patterns instead of fixed sets 2026-06-08 16:02:58 +02:00
lilleman 943a1d9f1b Add fakes library: recursive JSON template engine, i18n locales, Docker workflow 2026-06-05 19:51:18 +02:00