Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: regex_ testcases #54972

Merged
merged 1 commit into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/integration/targets/filters/files/foo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ TODO: realpath follows symlinks. There isn't a test for this just now.

TODO: add tests for set theory operations like union

TODO: add tests for regex, match, and search


regex_replace = bar
regex_search = 0001
regex_findall = "['car', 'tar', 'bar']"
regex_escape = \^f\.\*o\(\.\*\)\$
7 changes: 4 additions & 3 deletions test/integration/targets/filters/templates/foo.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ TODO: realpath follows symlinks. There isn't a test for this just now.

TODO: add tests for set theory operations like union

TODO: add tests for regex, match, and search


regex_replace = {{ 'foo' | regex_replace('^foo', 'bar') }}
regex_search = {{ 'test_value_0001' | regex_search('([0-9]+)$')}}
regex_findall = "{{ 'car\ntar\nfoo\nbar\n' | regex_findall('^.ar$', multiline=True) }}"
regex_escape = {{ '^f.*o(.*)$' | regex_escape() }}