-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1203 from HubSpot/pretty-test-templates
Make fixture test templates "pretty"
- Loading branch information
Showing
85 changed files
with
792 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
src/test/resources/eager/allows-deferred-lazy-reference-to-get-overridden.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}\ | ||
. |
6 changes: 4 additions & 2 deletions
6
src/test/resources/eager/allows-meta-context-var-overriding.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
18 changes: 14 additions & 4 deletions
18
src/test/resources/eager/allows-variable-sharing-alias-name.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
8 changes: 6 additions & 2 deletions
8
...test/resources/eager/commits-variables-from-do-tag-when-partially-resolved.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/test/resources/eager/correctly-defers-with-multiple-loops.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
src/test/resources/eager/defers-call-tag-with-deferred-argument.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}\ | ||
? |
8 changes: 6 additions & 2 deletions
8
src/test/resources/eager/defers-changes-within-deferred-set-block.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
16 changes: 14 additions & 2 deletions
16
src/test/resources/eager/defers-loop-setting-meta-context-var.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
16 changes: 13 additions & 3 deletions
16
src/test/resources/eager/defers-macro-for-do-and-print.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) %} |
11 changes: 9 additions & 2 deletions
11
src/test/resources/eager/defers-macro-in-expression.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
9 changes: 6 additions & 3 deletions
9
src/test/resources/eager/defers-on-immutable-mode.expected.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.