Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use static environment assert_template_result input values #1641

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

dylanahsmith
Copy link
Contributor

As part of #1621, we want tests for the liquid language itself, things that aren't liquid implementation specific. However, in practice we use the static environment for input even though assert_template_result is using the non-static environment that is shared with the counters. As such, this is neither testing behaviour which we see in practice, nor behaviour that we should need to preserve in a reimplementation of liquid, so I've changed assert_template_result to pass input values in the static environment.

Similarly, I've updated the increment/decrement tests to not depend on the ability to pass in initial values for these counters. I've also updated them to actually test the reading of the variables, which is observable behaviour.

So these can be tested using language tests, without needing support
for counter value input, which isn't needed if input is provided
through the static environment.
To match how we use liquid in practice
@dylanahsmith
Copy link
Contributor Author

@ianks & @samdoiron ping for review

@dylanahsmith dylanahsmith merged commit 1cd5ec5 into master Nov 2, 2022
@dylanahsmith dylanahsmith deleted the assert-template-result-static-env branch November 2, 2022 14:05
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.

2 participants