Skip to content

πŸ§ͺ Spec compliance test harness β€” YAML 1.2.2 Chapter 2 examplesΒ #20

@MariusStorhaug

Description

Track YAML 1.2.2 spec coverage with a single visible scoreboard. Add every Chapter 2 example from the YAML 1.2.2 spec as a Pester test. Tests for unsupported features start as -Skip and get unskipped as the feature lands via the linked follow-up issues.

Request

Add tests/Spec-1.2.2.Tests.ps1 with one It per Chapter 2 example. Each test name includes the example number and title (e.g. Example 2.4 - Sequence of Mappings). Tests for examples that already pass should run; tests for unsupported examples are marked -Skip with a comment referencing the tracking issue.

Scoreboard

# Title Status Tracked by
2.1 Sequence of Scalars βœ… supported β€”
2.2 Mapping Scalars to Scalars βœ… supported β€”
2.3 Mapping Scalars to Sequences βœ… supported β€”
2.4 Sequence of Mappings βœ… supported β€”
2.5 Sequence of Sequences (flow) ❌ deferred #7
2.6 Mapping of Mappings (flow) ❌ deferred #27
2.7 Two Documents in a Stream ❌ deferred #21
2.8 Play by Play Feed (multi-doc) ❌ deferred #21
2.9 Single Document with Two Comments βœ… supported β€”
2.10 Anchors and Aliases ❌ deferred #22
2.11 Mapping between Sequences (? key) ❌ deferred #25
2.12 Compact Nested Mapping ⚠️ verify β€”
2.13 Literal block scalar ❌ deferred #8
2.14 Folded block scalar ❌ deferred #8
2.15 Folded β€” more-indented lines ❌ deferred #8
2.16 Indentation determines scope ❌ deferred #8
2.17 Quoted Scalars βœ… supported β€”
2.18 Multi-line Flow Scalars ❌ deferred #8
2.19 Integers (octal, hex) ❌ deferred #26
2.20 Floating Point (.inf, .nan) ❌ deferred #26
2.21 Miscellaneous βœ… supported β€”
2.22 Timestamps ❌ deferred #23
2.23 Various Explicit Tags ❌ deferred #24
2.24 Global Tags ❌ deferred #24
2.25 Unordered Sets (!!set) ❌ deferred #24
2.26 Ordered Mappings (!!omap) ❌ deferred #24
2.27 Invoice (full-length) ❌ deferred depends on #22, #24, #8
2.28 Log File (multi-doc) ❌ deferred depends on #21, #8

Acceptance criteria

  • tests/Spec-1.2.2.Tests.ps1 exists and contains all 28 Chapter 2 examples
  • Tests for βœ… rows pass without -Skip
  • Tests for ❌ rows are present but -Skip-ped, each with a comment linking to the tracking issue
  • README references the spec test file as the source of truth for coverage

Technical decisions

  • Use Pester -Skip (not -ForEach filtering) so the test report shows the full surface and skipped count.
  • Each It block embeds the spec YAML verbatim as a here-string and asserts the resulting object equals the canonical JSON shown in the spec.
  • The harness lives separately from ConvertFrom-Yaml.Tests.ps1 / ConvertTo-Yaml.Tests.ps1 so spec tracking does not entangle behavior tests.

Implementation plan

  • Create tests/Spec-1.2.2.Tests.ps1 skeleton with Describe per section (2.1 Collections, 2.2 Structures, 2.3 Scalars, 2.4 Tags, 2.5 Full Length Example)
  • Add It blocks for examples 2.1–2.4, 2.9, 2.17, 2.21 (currently passing)
  • Add It -Skip blocks for the remaining examples, each with a TODO comment referencing the tracking issue
  • Verify Example 2.12 (compact nested mapping) β€” move out of ⚠️ once confirmed
  • Update README to link to this file

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions