diff options
Diffstat (limited to 'test/mapfile.sh')
-rw-r--r-- | test/mapfile.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/mapfile.sh b/test/mapfile.sh index 81054f1a..0d96c6ce 100644 --- a/test/mapfile.sh +++ b/test/mapfile.sh @@ -208,6 +208,20 @@ if mapfile_builtin; then } fi +# Test \ handling +{ + TMP=$(mktemp -t mapfile) + + expected='\blah\\b\\\\lah' + echo "${expected}" >> "${TMP}" + assert_ret 0 mapfile handle "${TMP}" "re" + unset line + assert_ret 0 mapfile_read "${handle}" line + assert_ret 0 mapfile_close "${handle}" + assert "${expected}" "${line}" "line with backslashes should match" + rm -f "${TMP}" +} + # Should only return full lines as read(1) does { rm -f "${TMP}" |