-
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.
Use sensible current path for eager execution test fixtures for relative
path resolving
- Loading branch information
1 parent
ffacfab
commit f1742bc
Showing
43 changed files
with
105 additions
and
101 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
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/allows-variable-sharing-alias-name/test.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,3 @@ | ||
{% import 'filters.jinja' as filters %} | ||
{% import './filters.jinja' as filters %} | ||
|
||
{{ filters }} |
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
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/does-not-override-import-modification-in-for/test.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,8 +1,8 @@ | ||
{% set foo = 'start' %} | ||
{% for i in range(2) %} | ||
{% import "deferred-modification.jinja" as bar1 %} | ||
{% import "../supplements/deferred-modification.jinja" as bar1 %} | ||
{{ bar1.foo }} | ||
{% import "deferred-modification.jinja" as bar2 %} | ||
{% import "../supplements/deferred-modification.jinja" as bar2 %} | ||
{{ bar2.foo }} | ||
{% endfor %} | ||
{{ foo }} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/fails-on-modification-in-aliased-macro/test.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
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/handles-deferred-from-import-as/test.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,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 }} |
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
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/handles-deferred-import-vars/test.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,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 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
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/handles-double-import-modification/test.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,6 @@ | ||
{% import "deferred-modification.jinja" as bar1 %} | ||
{% import "../supplements/deferred-modification.jinja" as bar1 %} | ||
--- | ||
{% import "deferred-modification.jinja" as bar2 %} | ||
{% import "../supplements/deferred-modification.jinja" as bar2 %} | ||
--- | ||
{{ bar1.foo }} | ||
{{ bar2.foo }} |
10 changes: 5 additions & 5 deletions
10
src/test/resources/eager/handles-import-in-deferred-if/test.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
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/handles-import-in-deferred-if/test.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
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/handles-import-with-macros-in-deferred-if/test.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,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 }} |
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/handles-non-deferred-import-vars/test.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,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 }} |
6 changes: 6 additions & 0 deletions
6
src/test/resources/eager/handles-same-name-import-var/set-var-and-deferred.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 |
---|---|---|
@@ -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 %} |
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/handles-same-name-import-var/test.expected.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 +1 @@ | ||
[fn:map_entry('import_resource_path', '../settag/set-var-and-deferred.jinja'), fn:map_entry('my_var', {'my_var': {'foo': 'bar'} , 'value': 'resolved', 'import_resource_path': '../settag/set-var-and-deferred.jinja'} ), fn:map_entry('path', ''), fn:map_entry('value', 'resolved')] | ||
[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')] |
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
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/handles-same-name-import-var/test.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,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 %} |
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/puts-deferred-fromed-macro-in-output/test.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,5 @@ | ||
{% set myname = deferred + 3 %}\ | ||
{% set __macro_getPath_331491059_temp_variable_1__ %}\ | ||
{% set __macro_getPath_1519775617_temp_variable_1__ %}\ | ||
Hello {{ myname }}\ | ||
{% endset %}\ | ||
{% print __macro_getPath_331491059_temp_variable_1__ %} | ||
{% print __macro_getPath_1519775617_temp_variable_1__ %} |
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/puts-deferred-fromed-macro-in-output/test.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,3 @@ | ||
{%- from "simple-with-call.jinja" import getPath -%} | ||
{%- from "../supplements/simple-with-call.jinja" import getPath -%} | ||
{%- set myname = deferred + (1 + 2) -%} | ||
{% print getPath() %} |
4 changes: 2 additions & 2 deletions
4
src/test/resources/eager/puts-deferred-imported-macro-in-output/test.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,5 @@ | ||
{% set myname = deferred + 3 %}\ | ||
{% set __macro_getPath_331491059_temp_variable_1__ %}\ | ||
{% set __macro_getPath_1519775617_temp_variable_1__ %}\ | ||
Hello {{ myname }}\ | ||
{% endset %}\ | ||
{% print __macro_getPath_331491059_temp_variable_1__ %} | ||
{% print __macro_getPath_1519775617_temp_variable_1__ %} |
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/puts-deferred-imported-macro-in-output/test.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,3 @@ | ||
{%- import "simple-with-call.jinja" as simple -%} | ||
{%- import "../supplements/simple-with-call.jinja" as simple -%} | ||
{%- set myname = deferred + (1 + 2) -%} | ||
{% print simple.getPath() %} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/test/resources/eager/reconstructs-aliased-macro/test.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
Oops, something went wrong.