Skip to content

Commit

Permalink
Merge pull request #1204 from HubSpot/cleanup-eager-fixtures
Browse files Browse the repository at this point in the history
Cleanup eager execution test fixtures
  • Loading branch information
jasmith-hs authored Sep 12, 2024
2 parents 9742adf + f1742bc commit 3e243de
Show file tree
Hide file tree
Showing 247 changed files with 341 additions and 298 deletions.
375 changes: 206 additions & 169 deletions src/test/java/com/hubspot/jinjava/EagerTest.java

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% do %}\
{% set current_path = 'filters.jinja' %}\
{% set current_path = 'eager/allows-variable-sharing-alias-name/filters.jinja' %}\
{% set __temp_import_alias_854547461__ = {} %}\
{% for __ignored__ in [0] %}
{% set bar = deferred %}\
Expand All @@ -8,10 +8,10 @@
{% set filters = {} %}\
{% do __temp_import_alias_854547461__.update({'filters': filters}) %}\
{% do filters.update(deferred) %}
{% do __temp_import_alias_854547461__.update({'bar': bar,'foo': 123,'import_resource_path': 'filters.jinja','filters': filters}) %}\
{% do __temp_import_alias_854547461__.update({'bar': bar,'foo': 123,'import_resource_path': 'eager/allows-variable-sharing-alias-name/filters.jinja','filters': filters}) %}\
{% endfor %}\
{% set filters = __temp_import_alias_854547461__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/allows-variable-sharing-alias-name/test.jinja' %}\
{% enddo %}

{{ filters }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% import './filters.jinja' as filters %}

{{ filters }}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set foo = 'start' %}\
{% for __ignored__ in [0] %}
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set current_path = 'eager/supplements/deferred-modification.jinja' %}\
{% set __temp_import_alias_3016318__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}
Expand All @@ -13,14 +13,14 @@

{% set foo = filter:join.filter([foo, 'b'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016318__.update({'foo': foo}) %}
{% do __temp_import_alias_3016318__.update({'foo': foo,'import_resource_path': 'deferred-modification.jinja'}) %}\
{% do __temp_import_alias_3016318__.update({'foo': foo,'import_resource_path': 'eager/supplements/deferred-modification.jinja'}) %}\
{% endfor %}\
{% set bar1 = __temp_import_alias_3016318__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/does-not-override-import-modification-in-for/test.jinja' %}\
{% enddo %}
{{ bar1.foo }}
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set current_path = 'eager/supplements/deferred-modification.jinja' %}\
{% set __temp_import_alias_3016319__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}
Expand All @@ -32,15 +32,15 @@

{% set foo = filter:join.filter([foo, 'b'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016319__.update({'foo': foo}) %}
{% do __temp_import_alias_3016319__.update({'import_resource_path': 'deferred-modification.jinja'}) %}\
{% do __temp_import_alias_3016319__.update({'import_resource_path': 'eager/supplements/deferred-modification.jinja'}) %}\
{% endfor %}\
{% set bar2 = __temp_import_alias_3016319__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/does-not-override-import-modification-in-for/test.jinja' %}\
{% enddo %}
{{ bar2.foo }}

{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set current_path = 'eager/supplements/deferred-modification.jinja' %}\
{% set __temp_import_alias_3016318__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}
Expand All @@ -52,14 +52,14 @@

{% set foo = filter:join.filter([foo, 'b'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016318__.update({'foo': foo}) %}
{% do __temp_import_alias_3016318__.update({'import_resource_path': 'deferred-modification.jinja'}) %}\
{% do __temp_import_alias_3016318__.update({'import_resource_path': 'eager/supplements/deferred-modification.jinja'}) %}\
{% endfor %}\
{% set bar1 = __temp_import_alias_3016318__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/does-not-override-import-modification-in-for/test.jinja' %}\
{% enddo %}
{{ bar1.foo }}
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set current_path = 'eager/supplements/deferred-modification.jinja' %}\
{% set __temp_import_alias_3016319__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}
Expand All @@ -71,10 +71,10 @@

{% set foo = filter:join.filter([foo, 'b'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016319__.update({'foo': foo}) %}
{% do __temp_import_alias_3016319__.update({'import_resource_path': 'deferred-modification.jinja'}) %}\
{% do __temp_import_alias_3016319__.update({'import_resource_path': 'eager/supplements/deferred-modification.jinja'}) %}\
{% endfor %}\
{% set bar2 = __temp_import_alias_3016319__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/does-not-override-import-modification-in-for/test.jinja' %}\
{% enddo %}
{{ bar2.foo }}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% set foo = 'start' %}
{% for i in range(2) %}
{% import "../supplements/deferred-modification.jinja" as bar1 %}
{{ bar1.foo }}
{% import "../supplements/deferred-modification.jinja" as bar2 %}
{{ bar2.foo }}
{% endfor %}
{{ foo }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% import 'eager/settings.jinja' as shared %}
{% import './settings.jinja' as shared %}

{% if deferred %}
{{ shared.load_settings() }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- set myname = deferred + (3 + 4) -%}
{%- from "macro-and-set.jinja" import foo as from_foo, bar as from_bar -%}
{%- from "../supplements/macro-and-set.jinja" import foo as from_foo, bar as from_bar -%}
from_foo: {{ from_foo() }}
from_bar: {{ from_bar }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ bar: {{ bar }}
---
{% set myname = deferred + 7 %}\
{% do %}\
{% set current_path = 'macro-and-set.jinja' %}\
{% set current_path = 'eager/supplements/macro-and-set.jinja' %}\
{% set __temp_import_alias_902286926__ = {} %}\
{% for __ignored__ in [0] %}
{% set bar = myname + 19 %}\
{% do __temp_import_alias_902286926__.update({'bar': bar}) %}
Hello {{ myname }}
{% do __temp_import_alias_902286926__.update({'import_resource_path': 'macro-and-set.jinja'}) %}\
{% do __temp_import_alias_902286926__.update({'import_resource_path': 'eager/supplements/macro-and-set.jinja'}) %}\
{% endfor %}\
{% set simple = __temp_import_alias_902286926__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/handles-deferred-import-vars/test.jinja' %}\
{% enddo %}\
simple.foo: {% set deferred_import_resource_path = 'macro-and-set.jinja' %}\
simple.foo: {% set deferred_import_resource_path = 'eager/supplements/macro-and-set.jinja' %}\
{% macro simple.foo() %}\
Hello {{ myname }}\
{% endmacro %}\
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{%- set myname = deferred + (1 + 2) -%}
{%- from "macro-and-set.jinja" import foo, bar -%}
{%- from "../supplements/macro-and-set.jinja" import foo, bar -%}
foo: {{ foo() }}
bar: {{ bar }}
---
{% set myname = deferred + (3 + 4) -%}
{%- import "macro-and-set.jinja" as simple -%}
{%- import "../supplements/macro-and-set.jinja" as simple -%}
simple.foo: {{ simple.foo() }}
simple.bar: {{ simple.bar }}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set current_path = 'eager/supplements/deferred-modification.jinja' %}\
{% set __temp_import_alias_3016318__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}
Expand All @@ -11,14 +11,14 @@

{% set foo = filter:join.filter([foo, 'b'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016318__.update({'foo': foo}) %}
{% do __temp_import_alias_3016318__.update({'foo': foo,'import_resource_path': 'deferred-modification.jinja'}) %}\
{% do __temp_import_alias_3016318__.update({'foo': foo,'import_resource_path': 'eager/supplements/deferred-modification.jinja'}) %}\
{% endfor %}\
{% set bar1 = __temp_import_alias_3016318__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/handles-double-import-modification/test.jinja' %}\
{% enddo %}
---
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set current_path = 'eager/supplements/deferred-modification.jinja' %}\
{% set __temp_import_alias_3016319__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}
Expand All @@ -30,11 +30,11 @@

{% set foo = filter:join.filter([foo, 'b'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016319__.update({'foo': foo}) %}
{% do __temp_import_alias_3016319__.update({'foo': foo,'import_resource_path': 'deferred-modification.jinja'}) %}\
{% do __temp_import_alias_3016319__.update({'foo': foo,'import_resource_path': 'eager/supplements/deferred-modification.jinja'}) %}\
{% endfor %}\
{% set bar2 = __temp_import_alias_3016319__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/handles-double-import-modification/test.jinja' %}\
{% enddo %}
---
{{ bar1.foo }}
{{ bar2.foo }}
{{ bar2.foo }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% import "../supplements/deferred-modification.jinja" as bar1 %}
---
{% import "../supplements/deferred-modification.jinja" as bar2 %}
---
{{ bar1.foo }}
{{ bar2.foo }}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{% set primary_line_height = 100 %}\
{% if deferred %}
{% do %}\
{% set current_path = '../settag/set-val.jinja' %}\
{% set current_path = 'eager/supplements/set-val.jinja' %}\
{% set __temp_import_alias_902286926__ = {} %}\
{% for __ignored__ in [0] %}\
{% set primary_line_height = 42 %}\
{% do __temp_import_alias_902286926__.update({'primary_line_height': primary_line_height}) %}\
{% do __temp_import_alias_902286926__.update({'primary_line_height': 42,'import_resource_path': '../settag/set-val.jinja'}) %}\
{% do __temp_import_alias_902286926__.update({'primary_line_height': 42,'import_resource_path': 'eager/supplements/set-val.jinja'}) %}\
{% endfor %}\
{% set simple = __temp_import_alias_902286926__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/handles-import-in-deferred-if/test.jinja' %}\
{% enddo %}
{% else %}
{% do %}\
{% set current_path = '../settag/set-val.jinja' %}\
{% set current_path = 'eager/supplements/set-val.jinja' %}\
{% set primary_line_height = 42 %}\
{% set current_path = '' %}\
{% set current_path = 'eager/handles-import-in-deferred-if/test.jinja' %}\
{% enddo %}
{% endif %}
simple.primary_line_height (deferred): {{ simple.primary_line_height }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% set primary_line_height = 100 %}
{% set secondary_line_height = 200 %}
{% if deferred %}
{% import "../settag/set-val.jinja" as simple %}
{% import "../supplements/set-val.jinja" as simple %}
{% else %}
{% import "../settag/set-val.jinja" %}
{% import "../supplements/set-val.jinja" %}
{% endif %}
simple.primary_line_height (deferred): {{ simple.primary_line_height }}
primary_line_height (deferred): {{ primary_line_height }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% set myname = 'person' %}
{% if deferred %}
{%- import "macro-and-set.jinja" as simple -%}
{%- import "../supplements/macro-and-set.jinja" as simple -%}
{% else %}
{%- import "macro-and-set.jinja" as simple -%}
{%- import "../supplements/macro-and-set.jinja" as simple -%}
{% endif %}
simple.foo: {{ simple.foo() }}
simple.bar: {{ simple.bar }}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{%- set myname = (1 + 2) -%}
{%- from "macro-and-set.jinja" import foo, bar -%}
{%- from "../supplements/macro-and-set.jinja" import foo, bar -%}
foo: {{ foo() }}
bar: {{ bar }}
---
{% set myname = (3 + 4) -%}
{%- import "macro-and-set.jinja" as simple -%}
{%- import "../supplements/macro-and-set.jinja" as simple -%}
simple.foo: {{ simple.foo() }}
simple.bar: {{ simple.bar }}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% if deferred %}
{% do %}{% set path = 'eager/handles-same-name-import-var/set-var-and-deferred.jinja' %}{% set value = null %}{% set my_var = {} %}{% set my_var = {'foo': 'bar'} %}{% set my_var = {'my_var': my_var} %}
{% set value = deferred %}{% do my_var.update({"value": value}) %}
{% do my_var.update({'import_resource_path': 'eager/handles-same-name-import-var/set-var-and-deferred.jinja','value': value}) %}{% set path = '' %}{% enddo %}
{{ my_var }}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[fn:map_entry('import_resource_path', 'eager/handles-same-name-import-var/set-var-and-deferred.jinja'), fn:map_entry('my_var', {'my_var': {'foo': 'bar'} , 'value': 'resolved', 'import_resource_path': 'eager/handles-same-name-import-var/set-var-and-deferred.jinja'} ), fn:map_entry('path', ''), fn:map_entry('value', 'resolved')]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if deferred %}
{% do %}\
{% set current_path = '../settag/set-var-and-deferred.jinja' %}\
{% set current_path = 'eager/handles-same-name-import-var/set-var-and-deferred.jinja' %}\
{% set __temp_import_alias_1059697132__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}
Expand All @@ -9,7 +9,7 @@
{% do __temp_import_alias_1059697132__.update({'path': path}) %}\
{% set my_var = {'my_var': {'foo': 'bar'} } %}\
{% do __temp_import_alias_1059697132__.update({'my_var': my_var}) %}\
{% set path = '../settag/set-var-and-deferred.jinja' %}\
{% set path = 'eager/handles-same-name-import-var/set-var-and-deferred.jinja' %}\
{% do __temp_import_alias_1059697132__.update({'path': path}) %}\
{% set value = null %}\
{% do __temp_import_alias_1059697132__.update({'value': value}) %}\
Expand All @@ -24,16 +24,16 @@
{% set my_var = {'my_var': {'foo': 'bar'} } %}\
{% do __temp_import_alias_1059697132__.update({'my_var': my_var}) %}\
{% do my_var.update({'value': value}) %}
{% do my_var.update({'import_resource_path': '../settag/set-var-and-deferred.jinja', 'value': value}) %}\
{% do my_var.update({'import_resource_path': 'eager/handles-same-name-import-var/set-var-and-deferred.jinja', 'value': value}) %}\
{% set path = '' %}\
{% do __temp_import_alias_1059697132__.update({'path': path}) %}\
{% enddo %}
{{ my_var }}
{% endif %}
{% do __temp_import_alias_1059697132__.update({'path': path,'import_resource_path': '../settag/set-var-and-deferred.jinja','value': value}) %}\
{% do __temp_import_alias_1059697132__.update({'path': path,'import_resource_path': 'eager/handles-same-name-import-var/set-var-and-deferred.jinja','value': value}) %}\
{% endfor %}\
{% set my_var = __temp_import_alias_1059697132__ %}\
{% set current_path = '' %}\
{% set current_path = 'eager/handles-same-name-import-var/test.jinja' %}\
{% enddo %}
{{ filter:dictsort.filter(my_var, ____int3rpr3t3r____, false, 'key') }}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if deferred %}
{% import '../settag/set-var-and-deferred.jinja' as my_var %}
{% import './set-var-and-deferred.jinja' as my_var %}
{{ my_var|dictsort(false, 'key') }}
{% endif %}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% set myname = deferred + 3 %}\
{% set __macro_getPath_1519775617_temp_variable_1__ %}\
Hello {{ myname }}\
{% endset %}\
{% print __macro_getPath_1519775617_temp_variable_1__ %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%- from "../supplements/simple-with-call.jinja" import getPath -%}
{%- set myname = deferred + (1 + 2) -%}
{% print getPath() %}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% set myname = deferred + 3 %}\
{% set __macro_getPath_1519775617_temp_variable_1__ %}\
Hello {{ myname }}\
{% endset %}\
{% print __macro_getPath_1519775617_temp_variable_1__ %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{%- import "simple-with-call.jinja" as simple -%}
{%- import "../supplements/simple-with-call.jinja" as simple -%}
{%- set myname = deferred + (1 + 2) -%}
{% print simple.getPath() %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set myname = deferred + 3 %}\
{% set deferred_import_resource_path = 'eager/takes-param.jinja' %}\
{% set deferred_import_resource_path = 'eager/reconstructs-aliased-macro/takes-param.jinja' %}\
{% macro macros.takes_param(foo) %}\
{% set bar = 'bar' %}
{% print foo %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- import "eager/takes-param.jinja" as macros -%}
{%- import "./takes-param.jinja" as macros -%}
{%- set myname = deferred + (1 + 2) -%}
{% set answer = macros.takes_param(myname) %}
{{ answer }}
Loading

0 comments on commit 3e243de

Please sign in to comment.