python-liquid 2.0.1__py3-none-any.whl → 2.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. liquid/__init__.py +1 -1
  2. liquid/builtin/expressions/loop.py +2 -5
  3. liquid/extra/tags/macro_tag.py +2 -0
  4. liquid/static_analysis.py +16 -10
  5. {python_liquid-2.0.1.dist-info → python_liquid-2.0.2.dist-info}/METADATA +2 -1
  6. python_liquid-2.0.2.dist-info/RECORD +95 -0
  7. liquid/golden/__init__.py +0 -173
  8. liquid/golden/abs_filter.py +0 -73
  9. liquid/golden/append_filter.py +0 -43
  10. liquid/golden/assign_tag.py +0 -45
  11. liquid/golden/at_least_filter.py +0 -78
  12. liquid/golden/at_most_filter.py +0 -68
  13. liquid/golden/base64_decode_filter.py +0 -43
  14. liquid/golden/base64_encode_filter.py +0 -42
  15. liquid/golden/base64_url_safe_decode_filter.py +0 -43
  16. liquid/golden/base64_url_safe_encode_filter.py +0 -42
  17. liquid/golden/capitalize_filter.py +0 -27
  18. liquid/golden/capture_tag.py +0 -39
  19. liquid/golden/case.py +0 -28
  20. liquid/golden/case_tag.py +0 -226
  21. liquid/golden/ceil_filter.py +0 -63
  22. liquid/golden/comment_tag.py +0 -119
  23. liquid/golden/compact_filter.py +0 -54
  24. liquid/golden/concat_filter.py +0 -63
  25. liquid/golden/cycle_tag.py +0 -114
  26. liquid/golden/date_filter.py +0 -63
  27. liquid/golden/decrement_tag.py +0 -16
  28. liquid/golden/default_filter.py +0 -112
  29. liquid/golden/divided_by_filter.py +0 -101
  30. liquid/golden/doc_tag.py +0 -61
  31. liquid/golden/downcase_filter.py +0 -27
  32. liquid/golden/echo_tag.py +0 -116
  33. liquid/golden/escape_filter.py +0 -27
  34. liquid/golden/escape_once_filter.py +0 -32
  35. liquid/golden/find_filter.py +0 -90
  36. liquid/golden/find_index_filter.py +0 -96
  37. liquid/golden/first_filter.py +0 -51
  38. liquid/golden/floor_filter.py +0 -63
  39. liquid/golden/for_tag.py +0 -642
  40. liquid/golden/has_filter.py +0 -139
  41. liquid/golden/identifiers.py +0 -249
  42. liquid/golden/if_tag.py +0 -531
  43. liquid/golden/ifchanged_tag.py +0 -46
  44. liquid/golden/illegal.py +0 -34
  45. liquid/golden/include_tag.py +0 -196
  46. liquid/golden/increment_tag.py +0 -48
  47. liquid/golden/inline_comment_tag.py +0 -127
  48. liquid/golden/join_filter.py +0 -69
  49. liquid/golden/last_filter.py +0 -51
  50. liquid/golden/liquid_tag.py +0 -215
  51. liquid/golden/lstrip_filter.py +0 -37
  52. liquid/golden/map_filter.py +0 -50
  53. liquid/golden/minus_filter.py +0 -58
  54. liquid/golden/modulo_filter.py +0 -60
  55. liquid/golden/newline_to_br_filter.py +0 -37
  56. liquid/golden/not_liquid.py +0 -16
  57. liquid/golden/output_statement.py +0 -295
  58. liquid/golden/plus_filter.py +0 -63
  59. liquid/golden/prepend_filter.py +0 -43
  60. liquid/golden/range_objects.py +0 -79
  61. liquid/golden/raw_tag.py +0 -31
  62. liquid/golden/reject_filter.py +0 -268
  63. liquid/golden/remove_filter.py +0 -45
  64. liquid/golden/remove_first_filter.py +0 -46
  65. liquid/golden/remove_last_filter.py +0 -46
  66. liquid/golden/render_tag.py +0 -210
  67. liquid/golden/replace_filter.py +0 -65
  68. liquid/golden/replace_first_filter.py +0 -59
  69. liquid/golden/replace_last_filter.py +0 -60
  70. liquid/golden/reverse_filter.py +0 -42
  71. liquid/golden/round_filter.py +0 -87
  72. liquid/golden/rstrip_filter.py +0 -37
  73. liquid/golden/size_filter.py +0 -42
  74. liquid/golden/slice_filter.py +0 -119
  75. liquid/golden/sort_filter.py +0 -86
  76. liquid/golden/sort_natural_filter.py +0 -105
  77. liquid/golden/special.py +0 -91
  78. liquid/golden/split_filter.py +0 -128
  79. liquid/golden/strip_filter.py +0 -37
  80. liquid/golden/strip_html_filter.py +0 -74
  81. liquid/golden/strip_newlines_filter.py +0 -37
  82. liquid/golden/sum_filter.py +0 -97
  83. liquid/golden/tablerow_tag.py +0 -399
  84. liquid/golden/times_filter.py +0 -53
  85. liquid/golden/truncate_filter.py +0 -61
  86. liquid/golden/truncatewords_filter.py +0 -94
  87. liquid/golden/uniq_filter.py +0 -87
  88. liquid/golden/unless_tag.py +0 -101
  89. liquid/golden/upcase_filter.py +0 -27
  90. liquid/golden/url_decode_filter.py +0 -27
  91. liquid/golden/url_encode_filter.py +0 -27
  92. liquid/golden/where_filter.py +0 -122
  93. liquid/golden/whitespace_control.py +0 -281
  94. python_liquid-2.0.1.dist-info/RECORD +0 -182
  95. {python_liquid-2.0.1.dist-info → python_liquid-2.0.2.dist-info}/WHEEL +0 -0
  96. {python_liquid-2.0.1.dist-info → python_liquid-2.0.2.dist-info}/licenses/LICENSE +0 -0
@@ -1,54 +0,0 @@
1
- """Golden tests cases for testing liquid's built-in `compact` filter."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="array with a nil",
8
- template=r"{{ a | compact | join: '#' }}",
9
- expect="b#a#A",
10
- globals={"a": ["b", "a", None, "A"]},
11
- ),
12
- Case(
13
- description="empty array",
14
- template=r"{{ a | compact | join: '#' }}",
15
- expect="",
16
- globals={"a": []},
17
- ),
18
- Case(
19
- description="too many arguments",
20
- template=r"{{ a | compact: 'foo', 'bar' }}",
21
- expect="",
22
- error=True,
23
- ),
24
- Case(
25
- description="left value is not an array",
26
- template=r"{{ a | compact | first }}",
27
- expect="123",
28
- globals={"a": 123},
29
- ),
30
- Case(
31
- description="left value is undefined",
32
- template=r"{{ nosuchthing | compact }}",
33
- expect="",
34
- ),
35
- Case(
36
- description="array of objects with key property",
37
- template=(
38
- r"{% assign x = a | compact: 'title' %}"
39
- r"{% for obj in x %}"
40
- r"{% for i in obj %}"
41
- r"({{ i[0] }},{{ i[1] }})"
42
- r"{% endfor %}"
43
- r"{% endfor %}"
44
- ),
45
- expect="(title,foo)(name,a)(title,bar)(name,c)",
46
- globals={
47
- "a": [
48
- {"title": "foo", "name": "a"},
49
- {"title": None, "name": "b"},
50
- {"title": "bar", "name": "c"},
51
- ]
52
- },
53
- ),
54
- ]
@@ -1,63 +0,0 @@
1
- """Golden tests cases for testing liquid's built-in `concat` filter."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="range literal concat filter left value",
8
- template=r"{{ (1..3) | concat: foo | join: '#' }}",
9
- expect="1#2#3#5#6#7",
10
- globals={"foo": [5, 6, 7]},
11
- ),
12
- Case(
13
- description="two arrays of strings",
14
- template=r"{{ a | concat: b | join: '#' }}",
15
- expect="a#b#c#d",
16
- globals={"a": ["a", "b"], "b": ["c", "d"]},
17
- ),
18
- Case(
19
- description="missing argument is an error",
20
- template=r"{{ a | concat | join: '#' }}",
21
- expect="a#b",
22
- globals={"a": ["a", "b"]},
23
- error=True,
24
- ),
25
- Case(
26
- description="non array-like argument is an error",
27
- template=r"{{ a | concat: b | join: '#' }}",
28
- expect="",
29
- globals={"a": ["a", "b"], "b": 5},
30
- error=True,
31
- ),
32
- Case(
33
- description="left value is not array-like",
34
- template=r"{{ a | concat: b | join: '#' }}",
35
- expect="ab#c#d",
36
- globals={"a": "ab", "b": ["c", "d"]},
37
- ),
38
- Case(
39
- description="left value contains non string",
40
- template=r"{{ a | concat: b | join: '#' }}",
41
- expect="a#b#5#c#d",
42
- globals={"a": ["a", "b", 5], "b": ["c", "d"]},
43
- ),
44
- Case(
45
- description="undefined left value",
46
- template=r"{{ nosuchthing | concat: b | join: '#' }}",
47
- expect="c#d",
48
- globals={"b": ["c", "d"]},
49
- ),
50
- Case(
51
- description="undefined argument is an error",
52
- template=r"{{ a | concat: nosuchthing | join: '#' }}",
53
- expect="",
54
- globals={"a": ["a", "b"]},
55
- error=True,
56
- ),
57
- Case(
58
- description="nested left value gets flattened",
59
- template=r"{{ a | concat: b | join: '#' }}",
60
- expect="a#x#b#y#z#c#d",
61
- globals={"a": [["a", "x"], ["b", ["y", ["z"]]]], "b": ["c", "d"]},
62
- ),
63
- ]
@@ -1,114 +0,0 @@
1
- """Golden tests cases for testing liquid's `cycle` tag."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="no identifier",
8
- template=(
9
- r"{% cycle 'some', 'other' %}"
10
- r"{% cycle 'some', 'other' %}"
11
- r"{% cycle 'some', 'other' %}"
12
- ),
13
- expect="someothersome",
14
- ),
15
- Case(
16
- description="with identifier",
17
- template=(
18
- r"{% cycle 'foo': 'some', 'other' %}"
19
- r"{% cycle 'some', 'other' %}"
20
- r"{% cycle 'foo': 'some', 'other' %}"
21
- ),
22
- expect="somesomeother",
23
- ),
24
- Case(
25
- description="different items",
26
- template=(
27
- r"{% cycle '1', '2', '3' %}"
28
- r"{% cycle '1', '2' %}"
29
- r"{% cycle '1', '2', '3' %}"
30
- ),
31
- expect="112",
32
- ),
33
- Case(
34
- description="integers",
35
- template=r"{% cycle 1, 2, 3 %}{% cycle 1, 2, 3 %}{% cycle 1, 2, 3 %}",
36
- expect="123",
37
- ),
38
- Case(
39
- description="some global variables",
40
- template=r"{% cycle a, b, c %}{% cycle a, b, c %}{% cycle a, b, c %}",
41
- expect="123",
42
- globals={"a": 1, "b": 2, "c": 3},
43
- standard=False,
44
- ),
45
- Case(
46
- description="variable name",
47
- template=r"{% cycle a: 1, 2, 3 %}{% cycle a: 1, 2, 3 %}{% cycle a: 1, 2, 3 %}",
48
- expect="123",
49
- globals={"a": "foo"},
50
- ),
51
- Case(
52
- description="multiple undefined variable names",
53
- template=r"{% cycle a: 1, 2, 3 %}{% cycle b: 1, 2, 3 %}{% cycle a: 1, 2, 3 %}",
54
- expect="123",
55
- globals={},
56
- ),
57
- Case(
58
- description="undefined variable names mixed with no name",
59
- template=r"{% cycle a: 1, 2, 3 %}{% cycle b: 1, 2, 3 %}{% cycle 1, 2, 3 %}",
60
- expect="121",
61
- globals={},
62
- ),
63
- Case(
64
- description="changing variable name",
65
- template=(
66
- r"{% cycle a: 1, 2, 3 %}"
67
- r"{% assign a = 'bar' %}"
68
- r"{% cycle a: 1, 2, 3 %}"
69
- r"{% cycle a: 1, 2, 3 %}"
70
- ),
71
- expect="112",
72
- globals={"a": "foo"},
73
- ),
74
- Case(
75
- description="named with different items",
76
- template=(
77
- r"{% cycle 'a': 1, 2, 3 %}"
78
- r"{% cycle 'a': 7, 8, 9 %}"
79
- r"{% cycle 'a': 1, 2, 3 %}"
80
- ),
81
- expect="183",
82
- future=True,
83
- ),
84
- Case(
85
- description="named with different number of arguments",
86
- template=(
87
- r"{% cycle a: '1', '2' %}"
88
- r"{% cycle a: '1', '2', '3' %}"
89
- r"{% cycle a: '1' %}"
90
- ),
91
- expect="12",
92
- future=True,
93
- ),
94
- Case(
95
- description="named with shrinking number of arguments",
96
- template=(
97
- r"{% cycle a: '1', '2', '3' %}"
98
- r"{% cycle a: '1', '2' %}"
99
- r"{% cycle a: '1' %}"
100
- ),
101
- expect="121",
102
- future=True,
103
- ),
104
- Case(
105
- description="named with growing number of arguments",
106
- template=(
107
- r"{% cycle a: '1' %}"
108
- r"{% cycle a: '1', '2' %}"
109
- r"{% cycle a: '1', '2', '3' %}"
110
- ),
111
- expect="112",
112
- future=True,
113
- ),
114
- ]
@@ -1,63 +0,0 @@
1
- """Golden tests cases for testing liquid's built-in `date` filter."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="well formed string",
8
- template=r"{{ 'March 14, 2016' | date: '%b %d, %y' }}",
9
- expect="Mar 14, 16",
10
- ),
11
- Case(
12
- description="too many arguments",
13
- template=r"{{ 'March 14, 2016' | date: '%b %d, %y', 'foo' }}",
14
- expect="",
15
- error=True,
16
- ),
17
- Case(
18
- description="undefined left value",
19
- template=r"{{ nosuchthing | date: '%b %d, %y' }}",
20
- expect="",
21
- ),
22
- Case(
23
- description="missing argument",
24
- template=r"{{ 'March 14, 2016' | date }}",
25
- expect="",
26
- error=True,
27
- ),
28
- Case(
29
- description="undefined argument",
30
- template=r"{{ 'March 14, 2016' | date: nosuchthing }}",
31
- expect="March 14, 2016",
32
- ),
33
- Case(
34
- description="literal percent",
35
- template=r"{{ 'March 14, 2016' | date: '%%%b %d, %y' }}",
36
- expect="%Mar 14, 16",
37
- ),
38
- Case(
39
- description="timestamp integer",
40
- template=r"{{ 1152098955 | date: '%m/%d/%Y' }}",
41
- expect="07/05/2006",
42
- ),
43
- Case(
44
- description="timestamp string",
45
- template=r"{{ '1152098955' | date: '%m/%d/%Y' }}",
46
- expect="07/05/2006",
47
- ),
48
- # Case(
49
- # description="negative timestamp integer",
50
- # template=r"{{ -1152098955 | date: '%m/%d/%Y' }}",
51
- # expect="06/29/1933",
52
- # ),
53
- Case(
54
- description="negative timestamp string",
55
- template=r"{{ '-1152098955' | date: '%m/%d/%Y' }}",
56
- expect="-1152098955",
57
- ),
58
- Case(
59
- description="seconds since epoch format directive",
60
- template=r"{{ 'March 14, 2016' | date: '%s' }}",
61
- expect="1457913600",
62
- ),
63
- ]
@@ -1,16 +0,0 @@
1
- """Golden tests cases for testing liquid's `decrement` tag."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="named counter",
8
- template=r"{% decrement foo %}{{ foo }} {% decrement foo %}{{ foo }}",
9
- expect="-1-1 -2-2",
10
- ),
11
- Case(
12
- description="increment and decrement named counter",
13
- template=r"{% decrement foo %} {% decrement foo %} {% increment foo %}",
14
- expect="-1 -2 -2",
15
- ),
16
- ]
@@ -1,112 +0,0 @@
1
- """Golden tests cases for testing liquid's built-in `default` filter."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="nil",
8
- template=r"{{ nil | default: 'foo' }}",
9
- expect="foo",
10
- ),
11
- Case(
12
- description="false",
13
- template=r"{{ False | default: 'foo' }}",
14
- expect="foo",
15
- ),
16
- Case(
17
- description="empty string",
18
- template=r'{{ "" | default: "foo" }}',
19
- expect="foo",
20
- ),
21
- Case(
22
- description="empty array",
23
- template=r"{{ a | default: 'foo' }}",
24
- expect="foo",
25
- globals={"a": []},
26
- ),
27
- Case(
28
- description="empty object",
29
- template=r"{{ a | default: 'foo' }}",
30
- expect="foo",
31
- globals={"a": {}},
32
- ),
33
- Case(
34
- description="not empty string",
35
- template=r'{{ "hello" | default: "foo" }}',
36
- expect="hello",
37
- ),
38
- Case(
39
- description="not empty list",
40
- template=r'{{ a | default: "foo" | join: "#" }}',
41
- expect="hello#world",
42
- globals={"a": ["hello", "world"]},
43
- ),
44
- Case(
45
- description="not empty object",
46
- template=(
47
- r"{% assign b = a | default: foo %}"
48
- r"{% for item in b %}"
49
- r"({{ item[0] }},{{ item[1] }})"
50
- r"{% endfor %}"
51
- ),
52
- expect="(greeting,hello)",
53
- globals={"a": {"greeting": "hello"}, "foo": {"greeting": "goodbye"}},
54
- ),
55
- Case(
56
- description="too many arguments",
57
- template=r"{{ None | default: 'foo', 'bar', 'baz' }}",
58
- expect="",
59
- error=True,
60
- ),
61
- Case(
62
- description="missing argument",
63
- template=r"{{ false | default }}",
64
- expect="",
65
- ),
66
- Case(
67
- description="empty",
68
- template=r"{{ empty | default: bar }}",
69
- expect="",
70
- ),
71
- Case(
72
- description="allow false",
73
- template=r"{{ false | default: 'bar', allow_false:true }}",
74
- expect="false",
75
- ),
76
- Case(
77
- description="allow false from context",
78
- template=r"{{ false | default: 'bar', allow_false:foo }}",
79
- expect="false",
80
- globals={"foo": True},
81
- ),
82
- Case(
83
- description="undefined left value",
84
- template=r'{{ nosuchthing | default: "bar" }}',
85
- expect="bar",
86
- ),
87
- Case(
88
- description="true keyword argument before positional",
89
- template=r'{{ false | default: allow_false: true, "bar" }}',
90
- expect="false",
91
- ),
92
- Case(
93
- description="false keyword argument before positional",
94
- template=r'{{ false | default: allow_false: false, "bar" }}',
95
- expect="bar",
96
- ),
97
- Case(
98
- description="zero is not falsy",
99
- template=r'{{ 0 | default: "bar" }}',
100
- expect="0",
101
- ),
102
- Case(
103
- description="zero is not falsy with allow_false",
104
- template=r'{{ 0 | default: "bar", allow_false: true }}',
105
- expect="0",
106
- ),
107
- Case(
108
- description="0.0 is not falsy",
109
- template=r'{{ 0.0 | default: "bar" }}',
110
- expect="0.0",
111
- ),
112
- ]
@@ -1,101 +0,0 @@
1
- """Golden tests cases for testing liquid's built-in `divided_by` filter."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="integer value and integer arg",
8
- template=r"{{ 10 | divided_by: 2 }}",
9
- expect="5",
10
- ),
11
- Case(
12
- description="integer value and float arg",
13
- template=r"{{ 10 | divided_by: 2.0 }}",
14
- expect="5.0",
15
- ),
16
- Case(
17
- description="integer division",
18
- template=r"{{ 9 | divided_by: 2 }}",
19
- expect="4",
20
- ),
21
- Case(
22
- description="float value and integer arg",
23
- template=r"{{ 9.0 | divided_by: 2 }}",
24
- expect="4.5",
25
- ),
26
- Case(
27
- description="float division",
28
- template=r"{{ 20 | divided_by: 7.0 }}",
29
- expect="2.857142857142857",
30
- ),
31
- Case(
32
- description="string value and argument",
33
- template=r'{{ "10" | divided_by: "2" }}',
34
- expect="5",
35
- ),
36
- Case(
37
- description="string not a number",
38
- template=r'{{ "foo" | divided_by: "2" }}',
39
- expect="0",
40
- ),
41
- Case(
42
- description="arg string not a number",
43
- template=r'{{ "10" | divided_by: "foo" }}',
44
- expect="",
45
- error=True,
46
- ),
47
- Case(
48
- description="too many args",
49
- template=r"{{ 5 | divided_by: 1, '5' }}",
50
- expect="",
51
- error=True,
52
- ),
53
- Case(
54
- description="not a string, int or float",
55
- template=r"{{ a | divided_by: 1 }}",
56
- expect="0",
57
- globals={"a": {}},
58
- ),
59
- Case(
60
- description="undefined left value",
61
- template=r"{{ nosuchthing | divided_by: 2 }}",
62
- expect="0",
63
- ),
64
- Case(
65
- description="undefined argument",
66
- template=r"{{ 10 | divided_by: nosuchthing }}",
67
- expect="",
68
- error=True,
69
- ),
70
- Case(
71
- description="divied by zero",
72
- template=r"{{ 10 | divided_by: 0 }}",
73
- expect="",
74
- error=True,
75
- ),
76
- Case(
77
- description="zero divided by float",
78
- template=r"{{ 0 | divided_by: 1.1 }}",
79
- expect="0.0",
80
- ),
81
- Case(
82
- description="zero divided by integer",
83
- template=r"{{ 0 | divided_by: 1 }}",
84
- expect="0",
85
- ),
86
- Case(
87
- description="issue",
88
- template=r"{{ 5 | divided_by: 3 }}",
89
- expect="1",
90
- ),
91
- Case(
92
- description="render",
93
- template=r"{{ 5.0 }} {{ 5 }}",
94
- expect="5.0 5",
95
- ),
96
- Case(
97
- description="left value is an empty string",
98
- template=r"{{ '' | divided_by: 2 }}",
99
- expect="0",
100
- ),
101
- ]
liquid/golden/doc_tag.py DELETED
@@ -1,61 +0,0 @@
1
- """Golden tests cases for testing liquid's `doc` tag."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="don't render docs",
8
- template=r"{% doc %}don't render me{% enddoc %}",
9
- expect="",
10
- ),
11
- Case(
12
- description="doc arguments is an error",
13
- template=r"{% doc hello %}don't render me{% enddoc %}",
14
- expect="",
15
- error=True,
16
- ),
17
- Case(
18
- description="doc tag block must be closed",
19
- template=r"{% doc %}don't render me",
20
- expect="",
21
- error=True,
22
- ),
23
- Case(
24
- description="doc text is not parsed",
25
- template=(
26
- r"{% doc %}"
27
- r" {% if true %}"
28
- r" {% if ... %}"
29
- r" {%- for ? -%}"
30
- r" {% while true %}"
31
- r" {%"
32
- r" unless if"
33
- r" %}"
34
- r" {% endcase %}"
35
- r" {% raw %}"
36
- r"{% enddoc %}"
37
- ),
38
- expect="",
39
- ),
40
- Case(
41
- description="nested docs are not allowed",
42
- template=r"{% doc hello %}Hello{% doc %}{% enddoc %}",
43
- expect="",
44
- error=True,
45
- ),
46
- Case(
47
- description="docs containing unclosed tags are ok",
48
- template=r"{% doc %}{% assign x = y {% enddoc %}",
49
- expect="",
50
- ),
51
- Case(
52
- description="docs containing unclosed output are ok",
53
- template=r"{% doc %}{{ foo {% enddoc %}",
54
- expect="",
55
- ),
56
- Case(
57
- description="whitespace control",
58
- template="foo\n {%- doc %}I'm a doc comment{% enddoc -%} \tbar",
59
- expect="foobar",
60
- ),
61
- ]
@@ -1,27 +0,0 @@
1
- """Golden tests cases for testing liquid's built-in `downcase` filter."""
2
-
3
- from liquid.golden.case import Case
4
-
5
- cases = [
6
- Case(
7
- description="make lower case",
8
- template=r'{{ "HELLO" | downcase }}',
9
- expect="hello",
10
- ),
11
- Case(
12
- description="not a string",
13
- template=r"{{ 5 | downcase }}",
14
- expect="5",
15
- ),
16
- Case(
17
- description="unexpected argument",
18
- template=r'{{ "HELLO" | downcase: 5 }}',
19
- expect="",
20
- error=True,
21
- ),
22
- Case(
23
- description="undefined left value",
24
- template=r"{{ nosuchthing | downcase }}",
25
- expect="",
26
- ),
27
- ]