Skip to content

Commit

Permalink
Avoid one level of info indentation in snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Sep 2, 2022
1 parent 552f74a commit 6340ad5
Show file tree
Hide file tree
Showing 53 changed files with 151 additions and 203 deletions.
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@adding.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "Strings:\n{{ 'to' + name + 'you' }}!\n{{ 'to' + 'you' }}!\n\nAdding:\n{{ 1 + 2 }}\n\nMinus:\n{{ 2 + 1 }}\n\nDivide:\n{{ 100 / 2 }}"
info:
ctx:
name: World
name: World
input_file: minijinja/tests/inputs/adding.txt
---
Strings:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{{ unsafe }}\n{% autoescape true %}{{ unsafe }}{% endautoescape %}\n{% autoescape false %}{{ unsafe }}{% endautoescape %}\n{% autoescape \"html\" %}{{ unsafe }}{% endautoescape %}\n{% autoescape \"none\" %}{{ unsafe }}{% endautoescape %}"
info:
ctx:
unsafe: "<foo>"
unsafe: "<foo>"
input_file: minijinja/tests/inputs/autoescape.html
---
&lt;foo&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{{ unsafe }}\n{% autoescape true %}{{ unsafe }}{% endautoescape %}\n{% autoescape false %}{{ unsafe }}{% endautoescape %}\n{% autoescape \"html\" %}{{ unsafe }}{% endautoescape %}\n{% autoescape \"none\" %}{{ unsafe }}{% endautoescape %}"
info:
ctx:
unsafe: "<foo>"
unsafe: "<foo>"
input_file: minijinja/tests/inputs/autoescape.txt
---
<foo>
Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@block.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "<title>{% block title %}{% endblock %}</title>\n{% block body %}{{ var }}{% endblock body %}"
info:
ctx:
var: foo
var: foo
input_file: minijinja/tests/inputs/block.txt
---
<title></title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% extends \"super_with_html.html\" %}\n{% block body %}\n <p>New Content</p>\n {{ super() }}\n {{ super()|upper }}\n{% endblock %}"
info:
ctx:
var: foo
var: foo
input_file: minijinja/tests/inputs/block_super.html
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% extends template %}\n{% block title %}[{{ super() }}]{% endblock %}\n{% block body %}{{ super()|upper }}{% endblock %}"
info:
ctx:
template: simple_layout.txt
template: simple_layout.txt
input_file: minijinja/tests/inputs/block_super.txt
---
<title>[default title]</title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
source: minijinja/tests/test_templates.rs
description: "{{ super() }}"
info:
ctx: {}
info: {}
input_file: minijinja/tests/inputs/block_super_err.txt
---
!!!ERROR!!!
Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@call.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% with f = range %}{% for x in f(upper) %}[{{ x }}]{% endfor %}{% endwith %}\n{% for k, v in dict(a=1, b=2, c=3)|dictsort %}[{{ k }}:{{ v }}]{% endfor %}"
info:
ctx:
upper: 10
upper: 10
input_file: minijinja/tests/inputs/call.txt
---
[0][1][2][3][4][5][6][7][8][9]
Expand Down
7 changes: 3 additions & 4 deletions minijinja/tests/snapshots/test_templates__vm@cmp.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
source: minijinja/tests/test_templates.rs
description: "{% if two > one and two < three %}\n test\n{% endif %}"
info:
ctx:
one: 1
three: 3
two: 2
one: 1
three: 3
two: 2
input_file: minijinja/tests/inputs/cmp.txt
---

Expand Down
5 changes: 2 additions & 3 deletions minijinja/tests/snapshots/test_templates__vm@concat.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
source: minijinja/tests/test_templates.rs
description: "{{ a ~ b }}"
info:
ctx:
a: foo
b: bar
a: foo
b: bar
input_file: minijinja/tests/inputs/concat.txt
---
foobar
Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@debug.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% with f = range %}{% for x in f(upper) %}{{ debug() }}{% endfor %}{% endwith %}"
info:
ctx:
upper: 1
upper: 1
input_file: minijinja/tests/inputs/debug.txt
---
State {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
source: minijinja/tests/test_templates.rs
description: "{{ undefined_value.attr }}"
info:
ctx: {}
info: {}
input_file: minijinja/tests/inputs/err_undefined_attr.txt
---
!!!ERROR!!!
Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@escape.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{{'\\'' ~ 'foo'}}\n{{'\\'' ~ x ~ '\\''}}\n{{\"\\'\" ~ x ~ '\\''}}\n{{\"\\'\" ~ x ~ '\\''}}\n{{\"\nhello world\"}}\n{{\"hello\nworld\"}}"
info:
ctx:
x: hello
x: hello
input_file: minijinja/tests/inputs/escape.txt
---
'foo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "<h1>{{ unsafe }}</h1>"
info:
ctx:
unsafe: "<foo>"
unsafe: "<foo>"
input_file: minijinja/tests/inputs/escaping.html
---
<h1>&lt;foo&gt;</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% extends template %}\n{% block title %}new title{% endblock %}\n{% block body %}new body{% endblock %}"
info:
ctx:
template: simple_layout.txt
template: simple_layout.txt
input_file: minijinja/tests/inputs/extends.txt
---
<title>new title</title>
Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@filter.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{{ value|upper }}"
info:
ctx:
value: foo bar baz
value: foo bar baz
input_file: minijinja/tests/inputs/filter.txt
---
FOO BAR BAZ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% filter escape %}<p>{{ value }}</p>{% endfilter %}"
info:
ctx:
value: foo < bar
value: foo < bar
input_file: minijinja/tests/inputs/filter_block.html
---
<p>foo &lt; bar</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% filter upper %}{{ egg }}{% endfilter %}"
info:
ctx:
egg: Humpty Dumpty sat on a wall
egg: Humpty Dumpty sat on a wall
input_file: minijinja/tests/inputs/filter_block.txt
---
HUMPTY DUMPTY SAT ON A WALL
Expand Down
21 changes: 10 additions & 11 deletions minijinja/tests/snapshots/test_templates__vm@filters.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
source: minijinja/tests/test_templates.rs
description: "lower: {{ word|lower }}\nupper: {{ word|upper }}\ntitle: {{ word|title }}\ntitle-sentence: {{ \"the bIrd, is The:word\"|title }}\nreplace: {{ word|replace(\"B\", \"th\") }}\nescape: {{ \"<\"|escape }}\ne: {{ \"<\"|e }}\ndouble-escape: {{ \"<\"|escape|escape }}\nsafe: {{ \"<\"|safe|escape }}\nlist-length: {{ list|length }}\nlist-from-list: {{ list|list }}\nlist-from-map: {{ map|list }}\nlist-from-word: {{ word|list }}\nlist-from-undefined: {{ undefined|list }}\nbool-empty-string: {{ \"\"|bool }}\nbool-non-empty-string: {{ \"hello\"|bool }}\nbool-empty-list: {{ []|bool }}\nbool-non-empty-list: {{ [42]|bool }}\nbool-undefined: {{ undefined|bool }}\nmap-length: {{ map|length }}\nstring-length: {{ word|length }}\nstring-count: {{ word|count }}\nreverse-list: {{ list|reverse }}\nreverse-string: {{ word|reverse }}\ntrim: |{{ word_with_spaces|trim }}|\ntrim-bird: {{ word|trim(\"Bd\") }}\njoin-default: {{ list|join }}\njoin-pipe: {{ list|join(\"|\") }}\njoin_string: {{ word|join('-') }}\ndefault: {{ undefined|default == \"\" }}\ndefault-value: {{ undefined|default(42) }}\nfirst-list: {{ list|first }}\nfirst-word: {{ word|first }}\nfirst-undefined: {{ []|first is undefined }}\nlast-list: {{ list|last }}\nlast-word: {{ word|last }}\nlast-undefined: {{ []|first is undefined }}\nd: {{ undefined|d == \"\" }}\njson: {{ map|tojson }}\njson-pretty: {{ map|tojson(true) }}\njson-scary-html: {{ scary_html|tojson }}\nurlencode: {{ \"hello world/foo-bar_baz.txt\"|urlencode }}\nurlencode-kv: {{ dict(a=\"x y\", b=2, c=3)|urlencode }}\nbatch: {{ range(10)|batch(3) }}\nbatch-fill: {{ range(10)|batch(3, '-') }}\nslice: {{ range(10)|slice(3) }}\nslice-fill: {{ range(10)|slice(3, '-') }}\nitems: {{ dict(a=1)|items }}\nint-abs: {{ -42|abs }}\nfloat-abs: {{ -42.5|abs }}\nint-round: {{ 42|round }}\nfloat-round: {{ 42.5|round }}\nfloat-round-prec2: {{ 42.512345|round(2) }}"
info:
ctx:
list:
- 1
- 2
- 3
map:
a: b
c: d
scary_html: "<>&'"
word: Bird
word_with_spaces: " Spacebird\n"
list:
- 1
- 2
- 3
map:
a: b
c: d
scary_html: "<>&'"
word: Bird
word_with_spaces: " Spacebird\n"
input_file: minijinja/tests/inputs/filters.txt
---
lower: bird
Expand Down
7 changes: 3 additions & 4 deletions minijinja/tests/snapshots/test_templates__vm@getattr.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
source: minijinja/tests/test_templates.rs
description: "name: {{ user.name }}\nactive: {{ user.is_active }}"
info:
ctx:
user:
is_active: true
name: Peter
user:
is_active: true
name: Peter
input_file: minijinja/tests/inputs/getattr.txt
---
name: Peter
Expand Down
13 changes: 6 additions & 7 deletions minijinja/tests/snapshots/test_templates__vm@getitem.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
source: minijinja/tests/test_templates.rs
description: "first: {{ items[0] }}\nlast: {{ items[-1] }}\nname: {{ user[\"name\"] }}"
info:
ctx:
items:
- first_item
- middle_item
- last_item
user:
name: Peter
items:
- first_item
- middle_item
- last_item
user:
name: Peter
input_file: minijinja/tests/inputs/getitem.txt
---
first: first_item
Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@hello.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "Hello {{ name }}!"
info:
ctx:
name: World
name: World
input_file: minijinja/tests/inputs/hello.txt
---
Hello World!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% if value %}\n was true\n{% endif %}"
info:
ctx:
value: 42
value: 42
input_file: minijinja/tests/inputs/if_cond.txt
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
source: minijinja/tests/test_templates.rs
description: "{% if value %}\n first branch\n{% elif other_value %}\n second branch\n{% else %}\n else\n{% endif %}"
info:
ctx:
other_value: false
value: false
other_value: false
value: false
input_file: minijinja/tests/inputs/if_cond_elif.txt
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{% if value %}\n was true\n{% else %}\n was false\n{% endif %}"
info:
ctx:
value: false
value: false
input_file: minijinja/tests/inputs/if_cond_else.txt
---

Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@ifexpr.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "{{ 42 if something_true else 23 }}\n{{ 42 if not something_true else 23 }}\n{{ 42 if not something_true }}\n{{ (42 if not something_true) is undefined }}"
info:
ctx:
something_true: true
something_true: true
input_file: minijinja/tests/inputs/ifexpr.txt
---
42
Expand Down
15 changes: 7 additions & 8 deletions minijinja/tests/snapshots/test_templates__vm@in.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
source: minijinja/tests/test_templates.rs
description: "{{ word in the_sentence }}\n{{ word in the_words }}\n{{ word in the_map }}\n{{ word not in the_sentence }}\n{{ word not in the_words }}\n{{ word not in the_map }}"
info:
ctx:
the_map:
bird: the word
the_sentence: bird is the word
the_words:
- bird
- not bird
word: bird
the_map:
bird: the word
the_sentence: bird is the word
the_words:
- bird
- not bird
word: bird
input_file: minijinja/tests/inputs/in.txt
---
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "Before\n{% with variable=42 %}\n {% include template %}\n{% endwith %}\nAfter"
info:
ctx:
template: simple_include.txt
template: simple_include.txt
input_file: minijinja/tests/inputs/include.txt
---
Before
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
source: minijinja/tests/test_templates.rs
description: "Before\n{% include [\"missing_template1.txt\", \"missing_template2.txt\"] %}\nAfter"
info:
ctx: {}
info: {}
input_file: minijinja/tests/inputs/include_choice_none.txt
---
!!!ERROR!!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "Before\n{% include [\"missing_template.txt\", template] %}\nAfter"
info:
ctx:
template: simple_include.txt
template: simple_include.txt
input_file: minijinja/tests/inputs/include_ignore_choice.txt
---
Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "Before\n{% include template ignore missing %}\nAfter"
info:
ctx:
template: missing_template.txt
template: missing_template.txt
input_file: minijinja/tests/inputs/include_ignore_missing.txt
---
Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
source: minijinja/tests/test_templates.rs
description: "Before\n{% include template %}\nAfter"
info:
ctx:
template: missing_template.txt
template: missing_template.txt
input_file: minijinja/tests/inputs/include_missing.txt
---
!!!ERROR!!!
Expand Down
9 changes: 4 additions & 5 deletions minijinja/tests/snapshots/test_templates__vm@inexpr.txt.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
source: minijinja/tests/test_templates.rs
description: "{{ 1 in seq }}\n{{ \"missing\" in seq }}\n{{ 1 not in seq }}\n{{ \"missing\" not in seq }}"
info:
ctx:
seq:
- 1
- 2
- 3
seq:
- 1
- 2
- 3
input_file: minijinja/tests/inputs/inexpr.txt
---
true
Expand Down
3 changes: 1 addition & 2 deletions minijinja/tests/snapshots/test_templates__vm@list.txt.snap
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
source: minijinja/tests/test_templates.rs
description: "{{ [1, 2, 3]|length }}"
info:
ctx: {}
info: {}
input_file: minijinja/tests/inputs/list.txt
---
3
Expand Down

0 comments on commit 6340ad5

Please sign in to comment.