Skip to content

Commit 53b2d5d

Browse files
dmealingclaude
andcommitted
test(ts): YAML conformance fixtures (ADR-0006 D4)
YAML is a TS-only authoring front-end, so its conformance corpus lives in this package — not under the repo-root fixtures/conformance/ corpus consumed by Java/Python/C#. Six fixtures cover the D1 desugar happy paths and the D2 + ERR_RESERVED_ATTR error paths: - yaml-sigil-free-attrs: bare @column/@objectRef/@storage/@required/@fields authored without `@` lower to canonical @-prefixed attrs. - yaml-mixed-bare-and-prefixed: an already-`@`-prefixed attr coexists with bare attrs (backward-compat accept-both). - yaml-array-suffix: `field.long[]` → canonical `field.long` + isArray: true. - error-yaml-coerced-bool-in-string: `column: TRUE` → ERR_YAML_COERCION. - error-yaml-coerced-num-in-enum: unquoted 42 in @values → ERR_YAML_COERCION + ERR_BAD_ATTR_VALUE (the coerced "42" then fails the enum identifier pattern). - error-yaml-reserved-as-attr: `@isArray` in YAML still triggers ERR_RESERVED_ATTR (the JSON corollary applies after desugar). The harness auto-discovers fixture directories — adding one adds a test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5e0e6f4 commit 53b2d5d

13 files changed

Lines changed: 263 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
{ "code": "ERR_YAML_COERCION" }
3+
]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
metadata:
2+
children:
3+
- object.entity:
4+
name: Product
5+
children:
6+
- field.string:
7+
name: active
8+
column: TRUE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
{ "code": "ERR_YAML_COERCION" },
3+
{ "code": "ERR_BAD_ATTR_VALUE" }
4+
]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
metadata:
2+
children:
3+
- object.entity:
4+
name: Product
5+
children:
6+
- field.enum:
7+
name: status
8+
values: ["DRAFT", 42, "PUBLISHED"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
{ "code": "ERR_RESERVED_ATTR" }
3+
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
metadata:
2+
children:
3+
- object.entity:
4+
name: Product
5+
"@isArray": true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"metadata.root": {
3+
"children": [
4+
{
5+
"object.entity": {
6+
"name": "Program",
7+
"children": [
8+
{
9+
"field.long": {
10+
"name": "weekIds",
11+
"isArray": true
12+
}
13+
}
14+
]
15+
}
16+
}
17+
]
18+
}
19+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
metadata:
2+
children:
3+
- object.entity:
4+
name: Program
5+
children:
6+
- field.long[]: weekIds
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"metadata.root": {
3+
"package": "acme",
4+
"children": [
5+
{
6+
"object.entity": {
7+
"name": "Product",
8+
"children": [
9+
{
10+
"field.object": {
11+
"name": "address",
12+
"@objectRef": "Address",
13+
"@storage": "flattened"
14+
}
15+
}
16+
]
17+
}
18+
}
19+
]
20+
}
21+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
metadata:
2+
package: acme
3+
children:
4+
- object.entity:
5+
name: Product
6+
children:
7+
- field.object:
8+
name: address
9+
"@objectRef": Address
10+
storage: flattened

0 commit comments

Comments
 (0)