Skip to content

Add captured self specs for scope across render boundaries#145

Open
karreiro wants to merge 1 commit into
self-drop-env-lookup-specsfrom
self-drop-tests-2
Open

Add captured self specs for scope across render boundaries#145
karreiro wants to merge 1 commit into
self-drop-env-lookup-specsfrom
self-drop-tests-2

Conversation

@karreiro

@karreiro karreiro commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Adds two new conformance specs in specs/liquid_ruby/bare_bracket_self.yml that define how a captured self behaves when crossing {% render %} boundaries. The first spec shows that self captured in the outer template continues to resolve through the original scope both before and inside the rendered snippet, while a freshly read self inside the snippet resolves to the snippet's own scope (outer|outer|snippet). The second spec extends this across three nested renders, proving that each level's captured self remains stable as render depth increases, while a fresh self in the innermost snippet sees its own scope (1|1/2|1/2/3).

These specs belong in liquid-spec because this behavior is a cross-implementation contract, not an implementation detail. They pass on both the Ruby reference adapter and the liquid-vm adapter, replacing prior liquid-vm-only integration tests. The corresponding liquid-vm PR updates the spec reference and removes the duplicated tests in favor of these shared conformance specs.

@karreiro karreiro requested a review from ianks June 12, 2026 10:34
@karreiro karreiro force-pushed the self-drop-tests-2 branch from 684002d to 4eecfb8 Compare June 12, 2026 12:25
@karreiro karreiro changed the base branch from main to self-drop-env-lookup-specs June 12, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant