Skip to content
Snippets Groups Projects
Commit 57f6f21b authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Global: added test cases for 'split' and 'filter' template filters

parent f306792f
No related branches found
No related tags found
No related merge requests found
......@@ -724,6 +724,35 @@ class MatchTestCase(MkexpSimpleTestCase):
as Ada
""")
class SplitTestCase(MkexpSimpleTestCase):
def test_basic(self):
self.run_test("""
%{'Douglas Noel Adams'|split(' ')}
%{'Douglas Noel Adams'|split(' ')}
""","""
['Douglas', 'Noel', '', 'Adams']
['Douglas Noel', 'Adams']
""")
def test_max_split(self):
self.run_test("""
%{'Douglas Noel Adams'|split(' ', 2)}
%{'Douglas Noel Adams'|split(' ', 1)}
""","""
['Douglas', 'Noel', ' Adams']
['Douglas', 'Noel Adams']
""")
class FilterTestCase(MkexpSimpleTestCase):
def test_basic(self):
self.run_test("""
%{['Douglas', 'Noel', '', 'Adams']|filter}
""","""
['Douglas', 'Noel', 'Adams']
""")
class WordwrapTestCase(MkexpSimpleTestCase):
def test_basic(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment