Files
alkgen/tests/fixtures/code/struct-writer.hbs
T
glm-5.3-flash 14d8a49611 test(fixtures): wave-1 engine fixture doubles (ssr-shaped and code-shaped)
- ssr double: page template composing header/footer partials under the
  HTML escaper, typed context built by a builder fn per ADR-004; golden
  pins for composition, escaping of hostile interpolation, the trusted
  {{& }} slot, and render-by-partial-name rejection
- code double: struct-writer template under the no-op escaper, typed
  context built from a schema document with kind mapping and
  source-escaped literals in the builder; golden pins for document-order
  arrays and the active preserve_order feature
- fixture assets are include_str! files under tests/fixtures/; fixture
  modules are per-test-binary so wave-2 proofs can grow them
- task file updated to completed with Notes and Summary

Verification: cargo test green (19 lib + 8 fixture tests), clippy
-D warnings clean, cargo fmt --check clean
2026-11-06 20:05:42 +00:00

11 lines
280 B
Handlebars

{{#each default_consts}}pub const {{const_name}}: &str = {{literal}};
{{/each}}
impl {{struct_name}} {
pub fn write<W: std::io::Write>(&self, out: &mut W) -> std::io::Result<()> {
{{#each fields}}
out.{{writer_call}}(&self.{{name}})?;
{{/each}}
Ok(())
}
}