From b82d8faf53893ee9d0e7b2c6d843efe702dadb57 Mon Sep 17 00:00:00 2001 From: shadmansaleh Date: Sat, 12 Jun 2021 23:09:57 +0600 Subject: [PATCH 1/2] Refactor(tests): Use os commands in mkdir_p helper --- test/functional/helpers.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 08ca14c3df..91c2364a72 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -878,9 +878,11 @@ function module.os_kill(pid) or 'kill -9 '..pid..' > /dev/null')) end --- Create directories with non exsisting intermidiate directories +-- Create folder with non existing parents function module.mkdir_p(path) - return module.meths.call_function('mkdir', {path, 'p'}) + return os.execute((iswin() + and 'mkdir '..path + or 'mkdir -p '..path)) end module = global_helpers.tbl_extend('error', module, global_helpers) From 27ea0d37e18d86c13c2e5ddb832ca6bff20f93de Mon Sep 17 00:00:00 2001 From: shadmansaleh Date: Sat, 12 Jun 2021 23:15:38 +0600 Subject: [PATCH 2/2] Refactor(tests): mkdir_p in startup/init.lua test --- test/functional/core/startup_spec.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 658dfbda60..a70b94c0e9 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -443,10 +443,7 @@ describe('user config init', function() before_each(function() rmdir(xhome) - -- TODO, make mkdir_p helper - mkdir(xhome) - mkdir(xconfig) - mkdir(xconfig .. pathsep .. 'nvim') + mkdir_p(xconfig .. pathsep .. 'nvim') write_file(init_lua_path, [[ vim.g.lua_rc = 1