alef 0.67.2

Opinionated polyglot binding generator for Rust libraries
Documentation
{# PHP synthetic field assertion template.
   Domain-shaped synthetic assertion kinds are rendered only after fixture or
   call config enables the matching assertion recipe.
   Context variables:
   - assertion_kind: "chunks_content", "chunks_embeddings", "embeddings", "embedding_dimensions",
                     "embeddings_valid", "keywords", "skipped", "result_is_simple",
                     "enum_variant_accessor_unavailable", "enum_variant_accessor_unspellable"
   - assertion_type: assertion type ("is_true", "is_false", "count_equals", "equals", etc.)
   - pred: predicate expression for boolean assertions
   - field_name: synthetic field name (for error messages)
   - result_var: result variable name
   - expr: expression to evaluate (for embedding_dimensions)
   - php_val: PHP formatted value string
#}
{% if assertion_kind == "chunks_content" %}
{% if assertion_type == "is_true" %}
        $this->assertTrue({{ pred }});
{% elif assertion_type == "is_false" %}
        $this->assertFalse({{ pred }});
{% else %}
        // skipped: unsupported assertion type on synthetic field '{{ field_name }}'
{% endif %}
{% elif assertion_kind == "chunks_embeddings" %}
{% if assertion_type == "is_true" %}
        $this->assertTrue({{ pred }});
{% elif assertion_type == "is_false" %}
        $this->assertFalse({{ pred }});
{% else %}
        // skipped: unsupported assertion type on synthetic field '{{ field_name }}'
{% endif %}
{% elif assertion_kind == "embeddings" %}
{% if assertion_type == "count_equals" %}
        $this->assertCount({{ php_val }}, ${{ result_var }});
{% elif assertion_type == "count_min" %}
        $this->assertGreaterThanOrEqual({{ php_val }}, count(${{ result_var }}));
{% elif assertion_type == "not_empty" %}
        $this->assertNotEmpty(${{ result_var }});
{% elif assertion_type == "is_empty" %}
        $this->assertEmpty(${{ result_var }});
{% else %}
        // skipped: unsupported assertion type on synthetic field 'embeddings'
{% endif %}
{% elif assertion_kind == "embedding_dimensions" %}
{% if assertion_type == "equals" %}
        $this->assertEquals({{ php_val }}, {{ expr }});
{% elif assertion_type == "greater_than" %}
        $this->assertGreaterThan({{ php_val }}, {{ expr }});
{% else %}
        // skipped: unsupported assertion type on synthetic field 'embedding_dimensions'
{% endif %}
{% elif assertion_kind == "embeddings_valid" or assertion_kind == "embeddings_finite" or assertion_kind == "embeddings_non_zero" or assertion_kind == "embeddings_normalized" %}
{% if assertion_type == "is_true" %}
        $this->assertTrue({{ pred }});
{% elif assertion_type == "is_false" %}
        $this->assertFalse({{ pred }});
{% else %}
        // skipped: unsupported assertion type on synthetic field '{{ field_name }}'
{% endif %}
{% elif assertion_kind == "keywords" %}
        // skipped: field '{{ field_name }}' not available on PHP result type
{% elif assertion_kind == "enum_variant_accessor_unavailable" %}
        // skipped: enum variant accessor '{{ field_name }}' not available in PHP (enum lowered to a string, not a class)
{% elif assertion_kind == "enum_variant_accessor_unspellable" %}
        // skipped: enum variant accessor '{{ field_name }}' not yet spellable in PHP (flat-class properties keep their snake_case name)
{% elif assertion_kind == "skipped" %}
        // skipped: field '{{ field_name }}' not available on result type
{% elif assertion_kind == "result_is_simple" %}
        // skipped: result_is_simple, field '{{ field_name }}' not on simple result type
{% endif %}