aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/has_spec.lua
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2021-10-30 08:55:32 +0900
committerGitHub <noreply@github.com>2021-10-29 16:55:32 -0700
commit16d06fa3eb74ed96b659736ea504c31ed81c325e (patch)
treea8e3e1b7e2426b697d10746378e61f9587d15432 /test/functional/vimscript/has_spec.lua
parentac358bfb2f644b79ab1f6f17dddcec1bf32f8d97 (diff)
downloadrneovim-16d06fa3eb74ed96b659736ea504c31ed81c325e.tar.gz
rneovim-16d06fa3eb74ed96b659736ea504c31ed81c325e.tar.bz2
rneovim-16d06fa3eb74ed96b659736ea504c31ed81c325e.zip
fix(eval): fix has('wsl') #16153
Problem: has('wsl') is decided at build-time. Solution: Check os_uname(). Fixes #12642, #16143
Diffstat (limited to 'test/functional/vimscript/has_spec.lua')
-rw-r--r--test/functional/vimscript/has_spec.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/vimscript/has_spec.lua b/test/functional/vimscript/has_spec.lua
index a3af2d1a20..c03fd13e0c 100644
--- a/test/functional/vimscript/has_spec.lua
+++ b/test/functional/vimscript/has_spec.lua
@@ -59,7 +59,12 @@ describe('has()', function()
end)
it('"wsl"', function()
- if 1 == funcs.has('win32') or 1 == funcs.has('mac') then
+ local luv = require('luv')
+ local is_wsl =
+ luv.os_uname()['release']:lower():match('microsoft') and true or false
+ if is_wsl then
+ eq(1, funcs.has('wsl'))
+ else
eq(0, funcs.has('wsl'))
end
end)