diff options
-rw-r--r-- | src/nvim/testdir/runnvim.vim | 12 | ||||
-rw-r--r-- | test/functional/helpers.lua | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/testdir/runnvim.vim b/src/nvim/testdir/runnvim.vim index 52e05cfbeb..a46e2d3fc0 100644 --- a/src/nvim/testdir/runnvim.vim +++ b/src/nvim/testdir/runnvim.vim @@ -7,6 +7,13 @@ function s:logger.on_exit(id, data, event) call add(self.d_events, [a:event, ['']]) endfunction +" Replace non-printable chars by special sequence, or "<%x>". +let s:escaped_char = {"\n": '\n', "\r": '\r', "\t": '\t'} +function! s:escape_non_printable(char) abort + let r = get(s:escaped_char, a:char) + return r is 0 ? printf('<%x>', char2nr(a:char)) : r +endfunction + function Main() let argc = +$NVIM_TEST_ARGC let args = [] @@ -26,9 +33,8 @@ function Main() \'join(map(v:val[1], '. \ '''substitute(v:val, '. \ '"\\v\\C(\\p@!.|\\<)", '. - \ '"\\=printf(\"<%x>\", '. - \ 'char2nr(submatch(0)))", '. - \ '"")''), '. + \ '"\\=s:escape_non_printable(submatch(0))", '. + \ '"g")''), '. \ '''\n'')') call setline(1, [ \ 'Job exited with code ' . results[0], diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index d4ace3030c..d040ff5f8c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -445,6 +445,8 @@ function module.new_argv(...) for _, k in ipairs({ 'HOME', 'ASAN_OPTIONS', + 'TSAN_OPTIONS', + 'MSAN_OPTIONS', 'LD_LIBRARY_PATH', 'PATH', 'NVIM_LOG_FILE', |