diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-09-05 15:02:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 15:02:46 -0700 |
commit | bedab7e87b038da11f93484c1bc1e036fea520b9 (patch) | |
tree | bec94773b8733b5e6a43ab449a632c62a7cccbab /test/functional/helpers.lua | |
parent | fb55cb2d91382d2646205c9a7709f9517eb7f153 (diff) | |
download | rneovim-bedab7e87b038da11f93484c1bc1e036fea520b9.tar.gz rneovim-bedab7e87b038da11f93484c1bc1e036fea520b9.tar.bz2 rneovim-bedab7e87b038da11f93484c1bc1e036fea520b9.zip |
provider: align all foo#Detect() functions #12839
Problem: ruby#Detect() and node#Detect() don't return a [prog, err] pair
which means callers must special-case them.
Solution: align their return signatures with the perl/pythonx providers.
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 82b6fb42e8..e4fb95442c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -768,18 +768,15 @@ function module.new_pipename() end function module.missing_provider(provider) - if provider == 'ruby' or provider == 'node' then - local prog = module.funcs['provider#' .. provider .. '#Detect']() - return prog == '' and (provider .. ' not detected') or false - elseif provider == 'perl' then - local errors = module.funcs['provider#'..provider..'#Detect']()[2] - return errors ~= '' and errors or false + if provider == 'ruby' or provider == 'node' or provider == 'perl' then + local e = module.funcs['provider#'..provider..'#Detect']()[2] + return e ~= '' and e or false elseif provider == 'python' or provider == 'python3' then local py_major_version = (provider == 'python3' and 3 or 2) - local errors = module.funcs['provider#pythonx#Detect'](py_major_version)[2] - return errors ~= '' and errors or false + local e = module.funcs['provider#pythonx#Detect'](py_major_version)[2] + return e ~= '' and e or false else - assert(false, 'Unknown provider: ' .. provider) + assert(false, 'Unknown provider: '..provider) end end |