py-regex-replace/test/test_multiline_replacement.sh

22 lines
374 B
Bash
Raw Normal View History

2022-06-23 14:50:49 +02:00
#!/usr/bin/env sh
string='alpha = a
beta = b
Exec = foo bar baz
end = EOF'
2022-10-17 22:02:36 +02:00
pattern='foo bar baz'
repl='foo bar baz\n\n o.O\n'
2022-06-23 14:50:49 +02:00
2022-06-23 23:35:19 +02:00
string="$(printf '%s' "${string}" | ../src/py_regex_replace/main.py -p "${pattern}" -r "${repl}" -c 1)"
2022-06-23 14:50:49 +02:00
printf 'RESULT>>>\n%s\n<<<RESULT\n' "${string}"
2023-03-20 19:54:46 +01:00
# RESULT>>>
# alpha = a
# beta = b
# Exec = foo bar baz
#
# o.O
#
# end = EOF
# <<<RESULT