aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2017-10-14 23:59:09 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-01-28 13:58:54 -0500
commit984a93df96f91af8343d62c145aee802cc1638f4 (patch)
treeded66e247b6c9bd6c6aae9fcae66192e1a4e91a8
parenteb59dd654759c3ecde7bea22e2651713e29d0912 (diff)
downloadrneovim-984a93df96f91af8343d62c145aee802cc1638f4.tar.gz
rneovim-984a93df96f91af8343d62c145aee802cc1638f4.tar.bz2
rneovim-984a93df96f91af8343d62c145aee802cc1638f4.zip
win: enable legacy/fnamemodify_spec.lua
-rw-r--r--test/functional/legacy/fnamemodify_spec.lua26
1 files changed, 18 insertions, 8 deletions
diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua
index d8ecbfe058..d8f812d77e 100644
--- a/test/functional/legacy/fnamemodify_spec.lua
+++ b/test/functional/legacy/fnamemodify_spec.lua
@@ -4,8 +4,6 @@ local helpers = require('test.functional.helpers')(after_each)
local clear, source = helpers.clear, helpers.source
local call, eq, nvim = helpers.call, helpers.eq, helpers.meths
-if helpers.pending_win32(pending) then return end
-
local function expected_empty()
eq({}, nvim.get_vvar('errors'))
end
@@ -16,17 +14,27 @@ describe('filename modifiers', function()
source([=[
func Test_fnamemodify()
- let tmpdir = resolve('/tmp')
+ if has('win32')
+ set shellslash
+ let tmpdir = expand('$LOCALAPPDATA/Temp')
+ call assert_equal(tmpdir, expand('$USERPROFILE/AppData/Local/Temp'))
+ else
+ let tmpdir = resolve('/tmp')
+ set shell=sh
+ endif
+ call assert_true(isdirectory(tmpdir))
execute 'cd '. tmpdir
- set shell=sh
- set shellslash
let $HOME=fnamemodify('.', ':p:h:h:h')
call assert_equal('/', fnamemodify('.', ':p')[-1:])
call assert_equal('p', fnamemodify('.', ':p:h')[-1:])
call assert_equal('t', fnamemodify('test.out', ':p')[-1:])
call assert_equal('test.out', fnamemodify('test.out', ':.'))
call assert_equal('../testdir/a', fnamemodify('../testdir/a', ':.'))
- call assert_equal('test.out', fnamemodify('test.out', ':~'))
+ if has('win32')
+ call assert_equal('~/Local/Temp/test.out', fnamemodify('test.out', ':~'))
+ else
+ call assert_equal('test.out', fnamemodify('test.out', ':~'))
+ endif
call assert_equal('../testdir/a', fnamemodify('../testdir/a', ':~'))
call assert_equal('a', fnamemodify('../testdir/a', ':t'))
call assert_equal('', fnamemodify('.', ':p:t'))
@@ -53,8 +61,10 @@ describe('filename modifiers', function()
quit
call assert_equal("'abc\ndef'", fnamemodify("abc\ndef", ':S'))
- set shell=tcsh
- call assert_equal("'abc\\\ndef'", fnamemodify("abc\ndef", ':S'))
+ if executable('tcsh')
+ set shell=tcsh
+ call assert_equal("'abc\\\ndef'", fnamemodify("abc\ndef", ':S'))
+ endif
endfunc
func Test_expand()