-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit test for checking updates to stencils
- Loading branch information
Showing
9 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/unittest/mascara/1_process_only_modified_3/10-templates/ab.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,18 @@ | ||
{%- import 'stencils/common.jinja' as common -%} | ||
|
||
{# -------------------------------------------------------------------------- #} | ||
|
||
{%- set all_variables = { | ||
'A': { | ||
'repeats': 5, | ||
}, | ||
'b': { | ||
'repeats': 3, | ||
}, | ||
} -%} | ||
|
||
{# -------------------------------------------------------------------------- #} | ||
|
||
{{- common.start_new_file('ab.txt') -}} | ||
|
||
{{- common.render(all_variables) -}} |
18 changes: 18 additions & 0 deletions
18
src/unittest/mascara/1_process_only_modified_3/10-templates/cd.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,18 @@ | ||
{%- import 'stencils/common.jinja' as common -%} | ||
|
||
{# -------------------------------------------------------------------------- #} | ||
|
||
{%- set all_variables = { | ||
'c': { | ||
'repeats': 2, | ||
}, | ||
'D': { | ||
'repeats': 10, | ||
}, | ||
} -%} | ||
|
||
{# -------------------------------------------------------------------------- #} | ||
|
||
{{- common.start_new_file('cd.txt') -}} | ||
|
||
{{- common.render(all_variables) -}} |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
src/unittest/mascara/1_process_only_modified_3/10-templates_updated/stencils/common.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,19 @@ | ||
{# Create a new file by inserting a special string into the output. #} | ||
{# This allows you to create multiple files from a single template. #} | ||
|
||
{%- macro start_new_file(filename) %} | ||
### New file: {{ filename }} | ||
### Content: | ||
{% endmacro -%} | ||
|
||
{# -------------------------------------------------------------------------- #} | ||
|
||
{% macro render(variables) %} | ||
{% for variable_key in variables -%} | ||
{%- for n in range(variables[variable_key].repeats) -%} | ||
{{ variable_key }} | ||
{{- '.' if not loop.last }} | ||
{%- endfor %} | ||
|
||
{% endfor %} | ||
{% endmacro %} |
2 changes: 2 additions & 0 deletions
2
src/unittest/mascara/1_process_only_modified_3/30-expected/ab.txt
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,2 @@ | ||
AAAAA | ||
bbb |
2 changes: 2 additions & 0 deletions
2
src/unittest/mascara/1_process_only_modified_3/30-expected/cd.txt
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,2 @@ | ||
cc | ||
DDDDDDDDDD |
2 changes: 2 additions & 0 deletions
2
src/unittest/mascara/1_process_only_modified_3/30-expected_updated/ab.txt
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,2 @@ | ||
A.A.A.A.A | ||
b.b.b |
2 changes: 2 additions & 0 deletions
2
src/unittest/mascara/1_process_only_modified_3/30-expected_updated/cd.txt
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,2 @@ | ||
c.c | ||
D.D.D.D.D.D.D.D.D.D |
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