Skip to content

Commit

Permalink
Replace cramped test output with escaped newlines for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmith-hs committed Sep 6, 2024
1 parent 1635d86 commit c6d002f
Show file tree
Hide file tree
Showing 83 changed files with 733 additions and 228 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{% set a_list = ['a', 'b'] %}{% for __ignored__ in [0] %}
{% set b_list = a_list %}{% if deferred %}
{% set a_list = ['a', 'b'] %}\
{% for __ignored__ in [0] %}
{% set b_list = a_list %}\
{% if deferred %}
{% set b_list = [deferred] %}
{% endif %}{% do b_list.append(deferred ? 'B' : '') %}
B: {{ b_list }}.{% endfor %}{% do a_list.append(deferred ? 'A' : '') %}
A: {{ a_list }}.
{% endif %}\
{% do b_list.append(deferred ? 'B' : '') %}
B: {{ b_list }}\
.{% endfor %}\
{% do a_list.append(deferred ? 'A' : '') %}
A: {{ a_list }}\
.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
0
META
{% for meta in deferred %}
{{ meta }}{% endfor %}
{{ meta }}\
{% endfor %}
META
{% set meta = [] %}{% if deferred %}
{% set meta = [] %}\
{% if deferred %}
{% do meta.append(1) %}
{% endif %}
{{ meta }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{% do %}{% set current_path = 'filters.jinja' %}{% set __temp_import_alias_854547461__ = {} %}{% for __ignored__ in [0] %}
{% set bar = deferred %}{% do __temp_import_alias_854547461__.update({'bar': bar}) %}
{% do %}\
{% set current_path = 'filters.jinja' %}\
{% set __temp_import_alias_854547461__ = {} %}\
{% for __ignored__ in [0] %}
{% set bar = deferred %}\
{% do __temp_import_alias_854547461__.update({'bar': bar}) %}

{% 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}) %}{% endfor %}{% set filters = __temp_import_alias_854547461__ %}{% set current_path = '' %}{% enddo %}
{% 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}) %}\
{% endfor %}\
{% set filters = __temp_import_alias_854547461__ %}\
{% set current_path = '' %}\
{% enddo %}

{{ filters }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{% do %}{% set list1 = ['b'] %}{% set list0 = ['a'] %}{% set list2 = ['c'] %}
{% do %}\
{% set list1 = ['b'] %}\
{% set list0 = ['a'] %}\
{% set list2 = ['c'] %}


{% set list2 = ['c'] %}{% do list2.append(deferred) %}
{% set list2 = ['c'] %}\
{% do list2.append(deferred) %}
{% unless deferred %}
{% set list0 = ['a', 'a'] %}
{% endunless %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set my_list = [] %}{% for __ignored__ in [0] %}
{% set my_list = [] %}\
{% for __ignored__ in [0] %}
{% for j in deferred %}
{% do my_list.append(0) %}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{% macro repeat(val) %}
{{ val }}
{{ caller() }}
{% endmacro %}{% call repeat(deferred) %}
{% endmacro %}\
{% call repeat(deferred) %}
macro 1
{% macro repeat(val) %}
{{ val }}
{{ caller() }}
{% endmacro %}{% call repeat(deferred + 1) %}
{% endmacro %}\
{% call repeat(deferred + 1) %}
macro2
{% endcall %}
{% endcall %}
3 changes: 2 additions & 1 deletion src/test/resources/eager/defers-caller.expected.jinja
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Jack says:
How do I get a {{ deferred }}?
How do I get a {{ deferred }}\
?
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
1
{% set bar = [1] %}{% set foo = '1' %}{% if deferred %}
{% set foo %}2{% do bar.append(2) %}{% endset %}
{% set bar = [1] %}\
{% set foo = '1' %}\
{% if deferred %}
{% set foo %}\
2{% do bar.append(2) %}\
{% endset %}
{% endif %}
Bar: {{ bar }}
Foo: {{ foo }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{% for __ignored__ in [0] %}
{% macro render(content, query) %}{% if query %}{{ content.foo }}{% endif %}{% endmacro %}{% set content = {'foo': 'a'} %}{{ render(content, deferred) }}
{% macro render(content, query) %}\
{% if query %}\
{{ content.foo }}\
{% endif %}\
{% endmacro %}\
{% set content = {'foo': 'a'} %}\
{{ render(content, deferred) }}

{% macro render(content, query) %}{% if query %}{{ content.foo }}{% endif %}{% endmacro %}{% set content = {'foo': 'b'} %}{{ render(content, deferred) }}
{% macro render(content, query) %}\
{% if query %}\
{{ content.foo }}\
{% endif %}\
{% endmacro %}\
{% set content = {'foo': 'b'} %}\
{{ render(content, deferred) }}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Is ([]),
Macro: [10]
Is ([10]),{% set my_list = [10] %}{% macro macro_append(num) %}{% do my_list.append(num) %}Macro: {{ my_list }}{% endmacro %}{% do macro_append(deferred) %}
Is ({{ my_list }}),
{% macro macro_append(num) %}{% do my_list.append(num) %}Macro: {{ my_list }}{% endmacro %}{% print macro_append(deferred2) %}
Is ([10]),{% set my_list = [10] %}\
{% macro macro_append(num) %}\
{% do my_list.append(num) %}\
Macro: {{ my_list }}\
{% endmacro %}\
{% do macro_append(deferred) %}
Is ({{ my_list }}\
),
{% macro macro_append(num) %}\
{% do my_list.append(num) %}\
Macro: {{ my_list }}\
{% endmacro %}\
{% print macro_append(deferred2) %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2
{% macro plus(foo, add) %}{{ foo + (filter:int.filter(add, ____int3rpr3t3r____)) }}{% endmacro %}{{ plus(deferred, 1.1) }}{% set deferred = deferred + 2 %}
{% macro plus(foo, add) %}{{ foo + (filter:int.filter(add, ____int3rpr3t3r____)) }}{% endmacro %}{{ plus(deferred, 3.1) }}
{% macro plus(foo, add) %}\
{{ foo + (filter:int.filter(add, ____int3rpr3t3r____)) }}\
{% endmacro %}\
{{ plus(deferred, 1.1) }}\
{% set deferred = deferred + 2 %}
{% macro plus(foo, add) %}\
{{ foo + (filter:int.filter(add, ____int3rpr3t3r____)) }}\
{% endmacro %}\
{{ plus(deferred, 3.1) }}
7 changes: 6 additions & 1 deletion src/test/resources/eager/defers-macro-in-for.expected.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{% set my_list = [] %}{% macro macro_append(num) %}{% do my_list.append(num) %}{{ my_list }}{% endmacro %}{% for item in filter:split.filter(macro_append(deferred), ____int3rpr3t3r____, ',', 2) %}
{% set my_list = [] %}\
{% macro macro_append(num) %}\
{% do my_list.append(num) %}\
{{ my_list }}\
{% endmacro %}\
{% for item in filter:split.filter(macro_append(deferred), ____int3rpr3t3r____, ',', 2) %}
{{ item }}
{% endfor %}
7 changes: 6 additions & 1 deletion src/test/resources/eager/defers-macro-in-if.expected.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{% set my_list = [] %}{% macro macro_append(num) %}{% do my_list.append(num) %}{{ my_list }}{% endmacro %}{% if [] == filter:split.filter(macro_append(deferred), ____int3rpr3t3r____, ',', 2) %}
{% set my_list = [] %}\
{% macro macro_append(num) %}\
{% do my_list.append(num) %}\
{{ my_list }}\
{% endmacro %}\
{% if [] == filter:split.filter(macro_append(deferred), ____int3rpr3t3r____, ',', 2) %}
{{ my_list }}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{% set foo = 1 %}{% if deferred %}
{% set foo = 1 %}\
{% if deferred %}
{% set foo = 2 %}
{% else %}
{% set foo = 3 %}
{% endif %}
{{ foo }}

{% for __ignored__ in [0] %}{% set bar = 1 + deferred %}
{% for __ignored__ in [0] %}\
{% set bar = 1 + deferred %}
{% set bar = bar + deferred %}
{% endfor %}1
{% endfor %}\
1
Original file line number Diff line number Diff line change
@@ -1,40 +1,81 @@
{% set foo = 'start' %}{% for __ignored__ in [0] %}
{% do %}{% set current_path = 'deferred-modification.jinja' %}{% set __temp_import_alias_3016318__ = {} %}{% for __ignored__ in [0] %}{% if deferred %}
{% set foo = 'start' %}\
{% for __ignored__ in [0] %}
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set __temp_import_alias_3016318__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}

{% set foo = 'starta' %}{% do __temp_import_alias_3016318__.update({'foo': foo}) %}
{% set foo = 'starta' %}\
{% do __temp_import_alias_3016318__.update({'foo': foo}) %}

{% endif %}

{% 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'}) %}{% endfor %}{% set bar1 = __temp_import_alias_3016318__ %}{% set current_path = '' %}{% enddo %}
{% 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'}) %}\
{% endfor %}\
{% set bar1 = __temp_import_alias_3016318__ %}\
{% set current_path = '' %}\
{% enddo %}
{{ bar1.foo }}
{% do %}{% set current_path = 'deferred-modification.jinja' %}{% set __temp_import_alias_3016319__ = {} %}{% for __ignored__ in [0] %}{% if deferred %}
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set __temp_import_alias_3016319__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}

{% set foo = filter:join.filter([foo, 'a'], ____int3rpr3t3r____, '') %}{% do __temp_import_alias_3016319__.update({'foo': foo}) %}
{% set foo = filter:join.filter([foo, 'a'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016319__.update({'foo': foo}) %}

{% endif %}

{% 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'}) %}{% endfor %}{% set bar2 = __temp_import_alias_3016319__ %}{% set current_path = '' %}{% enddo %}
{% 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'}) %}\
{% endfor %}\
{% set bar2 = __temp_import_alias_3016319__ %}\
{% set current_path = '' %}\
{% enddo %}
{{ bar2.foo }}

{% do %}{% set current_path = 'deferred-modification.jinja' %}{% set __temp_import_alias_3016318__ = {} %}{% for __ignored__ in [0] %}{% if deferred %}
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set __temp_import_alias_3016318__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}

{% set foo = filter:join.filter([foo, 'a'], ____int3rpr3t3r____, '') %}{% do __temp_import_alias_3016318__.update({'foo': foo}) %}
{% set foo = filter:join.filter([foo, 'a'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016318__.update({'foo': foo}) %}

{% endif %}

{% 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'}) %}{% endfor %}{% set bar1 = __temp_import_alias_3016318__ %}{% set current_path = '' %}{% enddo %}
{% 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'}) %}\
{% endfor %}\
{% set bar1 = __temp_import_alias_3016318__ %}\
{% set current_path = '' %}\
{% enddo %}
{{ bar1.foo }}
{% do %}{% set current_path = 'deferred-modification.jinja' %}{% set __temp_import_alias_3016319__ = {} %}{% for __ignored__ in [0] %}{% if deferred %}
{% do %}\
{% set current_path = 'deferred-modification.jinja' %}\
{% set __temp_import_alias_3016319__ = {} %}\
{% for __ignored__ in [0] %}\
{% if deferred %}

{% set foo = filter:join.filter([foo, 'a'], ____int3rpr3t3r____, '') %}{% do __temp_import_alias_3016319__.update({'foo': foo}) %}
{% set foo = filter:join.filter([foo, 'a'], ____int3rpr3t3r____, '') %}\
{% do __temp_import_alias_3016319__.update({'foo': foo}) %}

{% endif %}

{% 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'}) %}{% endfor %}{% set bar2 = __temp_import_alias_3016319__ %}{% set current_path = '' %}{% enddo %}
{% 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'}) %}\
{% endfor %}\
{% set bar2 = __temp_import_alias_3016319__ %}\
{% set current_path = '' %}\
{% enddo %}
{{ bar2.foo }}
{% endfor %}
{{ foo }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% set my_list = [] %}{% set foo %}
{% do my_list.append(deferred) %}a
{% set my_list = [] %}\
{% set foo %}
{% do my_list.append(deferred) %}\
a
{% endset %}
{{ my_list }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{% set my_list = ['a'] %}{% if deferred %}
{% set my_list = ['a'] %}\
{% if deferred %}
{% set __macro_append_stuff_153654787_temp_variable_0__ %}
{% set __macro_foo_97643642_temp_variable_1__ %}
{% do my_list.append('b') %}
{% endset %}{{ __macro_foo_97643642_temp_variable_1__ }}
{% endset %}\
{{ __macro_foo_97643642_temp_variable_1__ }}
{% set __macro_foo_97643642_temp_variable_2__ %}
{% do my_list.append('c') %}
{% endset %}{{ __macro_foo_97643642_temp_variable_2__ }}
{% endset %}{{ __macro_append_stuff_153654787_temp_variable_0__ }}
{% endset %}\
{{ __macro_foo_97643642_temp_variable_2__ }}
{% endset %}\
{{ __macro_append_stuff_153654787_temp_variable_0__ }}
{% endif %}

{% do my_list.append('d') %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set foo = 1 %}{% if deferred %}
{% set foo = 1 %}\
{% if deferred %}
{% set foo = 2 %}
{% else %}
{% set foo = 3 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% set foo = [0, 1] %}{% if deferred == true %}
{% set foo = [0, 1] %}\
{% if deferred == true %}
[0, 1]
{% do foo.append(2) %}
{% else %}
[0, 1]
{% do foo.append(3) %}
{% endif %}
{{ foo }}
{{ foo }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{% set my_list = ['a'] %}{% set __macro_foo_97643642_temp_variable_0__ %}
{% set my_list = ['a'] %}\
{% set __macro_foo_97643642_temp_variable_0__ %}
a
{% if deferred %}
{% do my_list.append('b') %}b
{% do my_list.append('b') %}\
b
{% endif %}
{% endset %}{{ __macro_foo_97643642_temp_variable_0__ }}
{% endset %}\
{{ __macro_foo_97643642_temp_variable_0__ }}
{{ my_list }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% set my_list = ['a'] %}{% set foo %}
{% set my_list = ['a'] %}\
{% set foo %}
a
{% if deferred %}
{% do my_list.append('b') %}b
{% do my_list.append('b') %}\
b
{% endif %}
{% endset %}
{{ my_list }}
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
{% set foo = [0] %}{% if false %}{% elif deferred && foo.append(1) %}1{% elif deferred && foo.append(2) %}2{% endif %}
{% set foo = [0] %}\
{% if false %}\
{% elif deferred && foo.append(1) %}\
1{% elif deferred && foo.append(2) %}\
2{% endif %}
{{ foo }}
Loading

0 comments on commit c6d002f

Please sign in to comment.