Write the loader fixture suite, valid and malformed
18 golden fixture boards as real on-disk trees under Fixtures/ — ten valid/tolerated cases (rich board, interrupted create, non-UUID strays, stray files, tombstones, tie-breaks, unknown-key order, coercion, last-wins duplicates, board-level deleted) and eight fail-fast cases, each pinned to its exact error reason and path; the rich board's whole tree round-trips byte-identically. Pins two contract subtleties now recorded in the design: tombstone flags are not inherited (renderers walk ancestors) and last-wins resolves before order strictness. README gains the storage-foundation feature entry. 146 tests total. Claude-Session: https://claude.ai/code/session_018BjQRYBR6jQja3jCRi5S3A
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 1024
|
||||
title: 2048
|
||||
---
|
||||
An unquoted integer title coerces to its source text, "2048".
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 2048
|
||||
title: [a, b]
|
||||
---
|
||||
A sequence has no sensible string reading — malformed, falls back to the
|
||||
untitled placeholder.
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 3072
|
||||
iconColor: 42
|
||||
---
|
||||
An integer iconColor coerces to its source text, "42" — not a real color,
|
||||
but the value round-trips rather than being rejected.
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 4096
|
||||
background: {x: 1}
|
||||
---
|
||||
A mapping has no sensible string reading — malformed, falls back to no
|
||||
color.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 5120
|
||||
background: 12345
|
||||
---
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 6144
|
||||
title: Deleted With An Unusable Timestamp
|
||||
deleted: definitely-not-a-date
|
||||
---
|
||||
The user's intent to delete outranks the broken date — this card still
|
||||
tombstones, its deletion date just unknown.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 1024
|
||||
title: Width Coerces From A Quoted Number
|
||||
width: "3"
|
||||
---
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
schema: 1
|
||||
order: 2048
|
||||
title: Width Is Unusable — Not An Integer
|
||||
width: 1.5
|
||||
---
|
||||
A malformed width is preserved on disk and simply not used — never
|
||||
rejected, never rewritten.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
schema: 1
|
||||
title: Coercion And Lenient-Field Fallback
|
||||
---
|
||||
Schema-owned display fields coerce where a sensible reading exists (a
|
||||
wrong-type scalar reads as its source text) and fall back to their default
|
||||
where none does (a sequence/mapping, a non-integer width). A present but
|
||||
unusable 'deleted' timestamp still tombstones — presence outranks validity.
|
||||
Reference in New Issue
Block a user