Add tests for all width variants.
This commit is contained in:
parent
121556f2ed
commit
32d33c7abe
|
|
@ -692,21 +692,33 @@ static void test_filters(testing & t) {
|
|||
);
|
||||
|
||||
test_template(t, "indent",
|
||||
"{{ data|indent(4) }}",
|
||||
"{{ data|indent(2) }}",
|
||||
{{ "data", "foo\nbar" }},
|
||||
"foo\n bar"
|
||||
);
|
||||
|
||||
test_template(t, "indent first only",
|
||||
"{{ data|indent(width=3,first=true) }}",
|
||||
{{ "data", "foo\nbar" }},
|
||||
" foo\n bar"
|
||||
);
|
||||
|
||||
test_template(t, "indent blank lines and first line",
|
||||
"{{ data|indent(width=5,blank=true,first=true) }}",
|
||||
{{ "data", "foo\n\nbar" }},
|
||||
" foo\n \n bar"
|
||||
);
|
||||
|
||||
test_template(t, "indent with default width",
|
||||
"{{ data|indent() }}",
|
||||
{{ "data", "foo\nbar" }},
|
||||
"foo\n bar"
|
||||
);
|
||||
|
||||
test_template(t, "indent first only",
|
||||
"{{ data|indent(width=4,first=true) }}",
|
||||
test_template(t, "indent with string",
|
||||
"{{ data|indent(width='>>>>') }}",
|
||||
{{ "data", "foo\nbar" }},
|
||||
" foo\n bar"
|
||||
);
|
||||
|
||||
test_template(t, "indent blank lines and first line",
|
||||
"{{ data|indent(width=4,blank=true,first=true) }}",
|
||||
{{ "data", "foo\n\nbar" }},
|
||||
" foo\n \n bar"
|
||||
"foo\n>>>>bar"
|
||||
);
|
||||
|
||||
test_template(t, "chained filters",
|
||||
|
|
|
|||
Loading…
Reference in New Issue