diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-14 20:34:54 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-14 20:34:54 +0200 | 
| commit | 58d2ce9bdbb6feab7176f451ca0248c78606aa2e (patch) | |
| tree | 00380fbf607a42b23d9e59b605d100c3340ad594 /test/helpers.lua | |
| parent | 45b5ebea9ddf029b3453ab21d20ae41f32c8de97 (diff) | |
| download | rneovim-58d2ce9bdbb6feab7176f451ca0248c78606aa2e.tar.gz rneovim-58d2ce9bdbb6feab7176f451ca0248c78606aa2e.tar.bz2 rneovim-58d2ce9bdbb6feab7176f451ca0248c78606aa2e.zip  | |
test: check_cores(): Escape $TMPDIR path. (#6520)
Lua string:match() considers hyphen to be a special char, we want the
path to be a literal match. Also remove "./", etc.
References #6483
Diffstat (limited to 'test/helpers.lua')
| -rw-r--r-- | test/helpers.lua | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/test/helpers.lua b/test/helpers.lua index d0b1ad552b..d60d5ba242 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -32,6 +32,9 @@ local function glob(initial_path, re, exc_re)      return false    end +  if is_excluded(initial_path) then +    return ret +  end    while #paths_to_check > 0 do      local cur_path = paths_to_check[#paths_to_check]      paths_to_check[#paths_to_check] = nil @@ -185,7 +188,11 @@ local function check_cores(app, force)    local gdb_db_cmd = 'gdb -n -batch -ex "thread apply all bt full" "$_NVIM_TEST_APP" -c "$_NVIM_TEST_CORE"'    local lldb_db_cmd = 'lldb -Q -o "bt all" -f "$_NVIM_TEST_APP" -c "$_NVIM_TEST_CORE"'    local random_skip = false -  local local_tmpdir = tmpdir_is_local(tmpdir_get()) and tmpdir_get() or nil +  -- Workspace-local $TMPDIR, scrubbed and pattern-escaped. +  -- "./Xtest-tmpdir/" => "Xtest%-tmpdir" +  local local_tmpdir = (tmpdir_is_local(tmpdir_get()) +    and tmpdir_get():gsub('^[ ./]+',''):gsub('%/+$',''):gsub('([^%w])', '%%%1') +    or nil)    local db_cmd    if hasenv('NVIM_TEST_CORE_GLOB_DIRECTORY') then      initial_path = os.getenv('NVIM_TEST_CORE_GLOB_DIRECTORY')  | 
