From afbdafffc2980c2879393ef03fc3edac49282ea7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 9 Jan 2018 01:06:59 +0100 Subject: test: fnamemodify() --- test/functional/eval/fnamemodify_spec.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/functional/eval/fnamemodify_spec.lua diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua new file mode 100644 index 0000000000..4f86626a1e --- /dev/null +++ b/test/functional/eval/fnamemodify_spec.lua @@ -0,0 +1,21 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear = helpers.clear +local eq = helpers.eq +local iswin = helpers.iswin +local fnamemodify = helpers.funcs.fnamemodify + +describe('fnamemodify()', function() + before_each(clear) + + it('works', function() + if iswin() then + eq([[C:\]], fnamemodify([[\]], ':p:h')) + eq([[C:\]], fnamemodify([[\]], ':p')) + eq([[C:/]], fnamemodify([[/]], ':p:h')) + eq([[C:/]], fnamemodify([[/]], ':p')) + else + eq('/', fnamemodify([[/]], ':p:h')) + eq('/', fnamemodify([[/]], ':p')) + end + end) +end) -- cgit From a619c3fcf92e45e27066c472c3c9a0a1a2901b4d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 11 Jan 2018 11:05:15 -0500 Subject: test: win: add tests for shellslash --- test/functional/eval/fnamemodify_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua index 4f86626a1e..f3705d6c99 100644 --- a/test/functional/eval/fnamemodify_spec.lua +++ b/test/functional/eval/fnamemodify_spec.lua @@ -3,6 +3,7 @@ local clear = helpers.clear local eq = helpers.eq local iswin = helpers.iswin local fnamemodify = helpers.funcs.fnamemodify +local command = helpers.command describe('fnamemodify()', function() before_each(clear) @@ -11,6 +12,11 @@ describe('fnamemodify()', function() if iswin() then eq([[C:\]], fnamemodify([[\]], ':p:h')) eq([[C:\]], fnamemodify([[\]], ':p')) + eq([[C:\]], fnamemodify([[/]], ':p:h')) + eq([[C:\]], fnamemodify([[/]], ':p')) + command('set shellslash') + eq([[C:/]], fnamemodify([[\]], ':p:h')) + eq([[C:/]], fnamemodify([[\]], ':p')) eq([[C:/]], fnamemodify([[/]], ':p:h')) eq([[C:/]], fnamemodify([[/]], ':p')) else -- cgit From 909c967f35c3d38be6d98d7dba6cfd087a6542f4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 11 Jan 2018 11:35:07 -0500 Subject: win: detect / and \ as root path separator --- src/nvim/path.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nvim/path.c b/src/nvim/path.c index 09cede8805..d18d9ecace 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -2202,7 +2202,11 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, // expand it if forced or not an absolute path if (force || !path_is_absolute_path(fname)) { - if ((p = vim_strrchr(fname, PATHSEP)) != NULL) { + p = vim_strrchr(fname, "/") +#ifdef WIN32 + if (p == NULL) p = vim_strrchr(fname, "\\") +#endif + if (p != NULL) { // relative to root if (p == fname) { // only one path component -- cgit From e39be42c0998d8048354961cd7a0864111c01e0b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 11 Jan 2018 11:56:29 -0500 Subject: fixup: compile-time errors --- src/nvim/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/path.c b/src/nvim/path.c index d18d9ecace..8e4f72be68 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -2202,9 +2202,9 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, // expand it if forced or not an absolute path if (force || !path_is_absolute_path(fname)) { - p = vim_strrchr(fname, "/") + p = vim_strrchr(fname, PATHSEP); #ifdef WIN32 - if (p == NULL) p = vim_strrchr(fname, "\\") + if (p == NULL) p = vim_strrchr(fname, '/'); #endif if (p != NULL) { // relative to root -- cgit From ec5af91b90a6e1d7b8e6f789c3d435316391a4c6 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 11 Jan 2018 16:27:10 -0500 Subject: win: explicitly specify pathsep --- src/nvim/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/path.c b/src/nvim/path.c index 8e4f72be68..d8f5163ed0 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -2202,9 +2202,9 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, // expand it if forced or not an absolute path if (force || !path_is_absolute_path(fname)) { - p = vim_strrchr(fname, PATHSEP); + p = vim_strrchr(fname, '/'); #ifdef WIN32 - if (p == NULL) p = vim_strrchr(fname, '/'); + if (p == NULL) p = vim_strrchr(fname, '\\'); #endif if (p != NULL) { // relative to root -- cgit From 534abe4aafc2fb75a100c6193a8fdf5bfa0838dc Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 11 Jan 2018 17:31:29 -0500 Subject: test: win: get current network drive via io.popen --- test/functional/eval/fnamemodify_spec.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua index f3705d6c99..21e670c41c 100644 --- a/test/functional/eval/fnamemodify_spec.lua +++ b/test/functional/eval/fnamemodify_spec.lua @@ -9,16 +9,22 @@ describe('fnamemodify()', function() before_each(clear) it('works', function() + local drive_f = io.popen('cd', 'r') + local drive = string.gsub(drive_f:read('*a'), '[\n\r]', '') + drive_f:close() + if iswin() then - eq([[C:\]], fnamemodify([[\]], ':p:h')) - eq([[C:\]], fnamemodify([[\]], ':p')) - eq([[C:\]], fnamemodify([[/]], ':p:h')) - eq([[C:\]], fnamemodify([[/]], ':p')) + local root = drive..[[\]] + eq(root, fnamemodify([[\]], ':p:h')) + eq(root, fnamemodify([[\]], ':p')) + eq(root, fnamemodify([[/]], ':p:h')) + eq(root, fnamemodify([[/]], ':p')) command('set shellslash') - eq([[C:/]], fnamemodify([[\]], ':p:h')) - eq([[C:/]], fnamemodify([[\]], ':p')) - eq([[C:/]], fnamemodify([[/]], ':p:h')) - eq([[C:/]], fnamemodify([[/]], ':p')) + root = drive..[[/]] + eq(root, fnamemodify([[\]], ':p:h')) + eq(root, fnamemodify([[\]], ':p')) + eq(root, fnamemodify([[/]], ':p:h')) + eq(root, fnamemodify([[/]], ':p')) else eq('/', fnamemodify([[/]], ':p:h')) eq('/', fnamemodify([[/]], ':p')) -- cgit From 273c7cfa2a01430411ce4c58c354e42337c6e6a7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 11 Jan 2018 17:35:36 -0500 Subject: fixup: lint errors --- src/nvim/path.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/path.c b/src/nvim/path.c index d8f5163ed0..21ac064c30 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -2204,7 +2204,9 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, if (force || !path_is_absolute_path(fname)) { p = vim_strrchr(fname, '/'); #ifdef WIN32 - if (p == NULL) p = vim_strrchr(fname, '\\'); + if (p == NULL) { + p = vim_strrchr(fname, '\\'); + } #endif if (p != NULL) { // relative to root -- cgit From eb59dd654759c3ecde7bea22e2651713e29d0912 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 11 Jan 2018 19:16:39 -0500 Subject: fixup: get network drive only, not entire path --- test/functional/eval/fnamemodify_spec.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua index 21e670c41c..2225c5da7c 100644 --- a/test/functional/eval/fnamemodify_spec.lua +++ b/test/functional/eval/fnamemodify_spec.lua @@ -9,11 +9,10 @@ describe('fnamemodify()', function() before_each(clear) it('works', function() - local drive_f = io.popen('cd', 'r') - local drive = string.gsub(drive_f:read('*a'), '[\n\r]', '') - drive_f:close() - if iswin() then + local drive_f = io.popen('for %P in (%CD%) do @echo %~dP', 'r') + local drive = string.gsub(drive_f:read('*a'), '[\n\r]', '') + drive_f:close() local root = drive..[[\]] eq(root, fnamemodify([[\]], ':p:h')) eq(root, fnamemodify([[\]], ':p')) -- cgit From 984a93df96f91af8343d62c145aee802cc1638f4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 14 Oct 2017 23:59:09 -0400 Subject: win: enable legacy/fnamemodify_spec.lua --- test/functional/legacy/fnamemodify_spec.lua | 26 ++++++++++++++++++-------- 1 file 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() -- cgit From 5a39d2d00e398b404b4db7ec45b2f490d5bb845e Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 13 Jan 2018 08:25:11 -0500 Subject: test: fnamemodify with :8 filename modifier --- test/functional/eval/fnamemodify_spec.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua index 2225c5da7c..52dfe1a55f 100644 --- a/test/functional/eval/fnamemodify_spec.lua +++ b/test/functional/eval/fnamemodify_spec.lua @@ -4,10 +4,19 @@ local eq = helpers.eq local iswin = helpers.iswin local fnamemodify = helpers.funcs.fnamemodify local command = helpers.command +local write_file = helpers.write_file describe('fnamemodify()', function() + setup(function() + write_file('Xtest-fnamemodify.txt', [[foobar]]) + end) + before_each(clear) + teardown(function() + os.remove('Xtest-fnamemodify.txt') + end) + it('works', function() if iswin() then local drive_f = io.popen('for %P in (%CD%) do @echo %~dP', 'r') @@ -29,4 +38,8 @@ describe('fnamemodify()', function() eq('/', fnamemodify([[/]], ':p')) end end) + + it(':8 works', function() + eq('Xtest-fnamemodify.txt', fnamemodify([[Xtest-fnamemodify.txt]], ':8')) + end) end) -- cgit From c08c09add745a7cfba0428d7cfd2238d3cb1474b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 15 Jan 2018 22:43:59 -0500 Subject: test: try $TMPDIR for temporary directory --- test/functional/legacy/fnamemodify_spec.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index d8f812d77e..c1a50387a3 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -16,12 +16,10 @@ describe('filename modifiers', function() func Test_fnamemodify() 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 + let tmpdir = $TMPDIR call assert_true(isdirectory(tmpdir)) execute 'cd '. tmpdir let $HOME=fnamemodify('.', ':p:h:h:h') @@ -30,11 +28,7 @@ describe('filename modifiers', function() 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', ':.')) - 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('test.out', fnamemodify('test.out', ':~')) call assert_equal('../testdir/a', fnamemodify('../testdir/a', ':~')) call assert_equal('a', fnamemodify('../testdir/a', ':t')) call assert_equal('', fnamemodify('.', ':p:t')) -- cgit From 28236867a0aa0e4dbb8e6c3f5b1d1c6ccbb2c7e1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 15 Jan 2018 23:45:02 -0500 Subject: test: fix failed test cases with tmpdir = $TMPDIR --- test/functional/legacy/fnamemodify_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index c1a50387a3..e86c7ba27c 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -22,13 +22,13 @@ describe('filename modifiers', function() let tmpdir = $TMPDIR call assert_true(isdirectory(tmpdir)) execute 'cd '. tmpdir - let $HOME=fnamemodify('.', ':p:h:h:h') + let $HOME=fnamemodify('.', ':p:h:h') call assert_equal('/', fnamemodify('.', ':p')[-1:]) - call assert_equal('p', fnamemodify('.', ':p:h')[-1:]) + call assert_equal('r', 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', ':~')) + call assert_equal('~/Xtest-tmpdir/test.out', fnamemodify('test.out', ':~')) call assert_equal('../testdir/a', fnamemodify('../testdir/a', ':~')) call assert_equal('a', fnamemodify('../testdir/a', ':t')) call assert_equal('', fnamemodify('.', ':p:t')) -- cgit From 7ac21332cf8ba5a4d3222d4a7fa1c760ef531f17 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 16 Jan 2018 08:41:31 -0500 Subject: Revert "test: fix failed test cases with tmpdir = $TMPDIR" This reverts commit f7fe3012204169f22412194a78f196ffc72bb8c3. Fails on QuickBuild because it uses a non-local path. Need a environment-agnostic solution --- test/functional/legacy/fnamemodify_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index e86c7ba27c..c1a50387a3 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -22,13 +22,13 @@ describe('filename modifiers', function() let tmpdir = $TMPDIR call assert_true(isdirectory(tmpdir)) execute 'cd '. tmpdir - let $HOME=fnamemodify('.', ':p:h:h') + let $HOME=fnamemodify('.', ':p:h:h:h') call assert_equal('/', fnamemodify('.', ':p')[-1:]) - call assert_equal('r', fnamemodify('.', ':p:h')[-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('~/Xtest-tmpdir/test.out', fnamemodify('test.out', ':~')) + call assert_equal('test.out', fnamemodify('test.out', ':~')) call assert_equal('../testdir/a', fnamemodify('../testdir/a', ':~')) call assert_equal('a', fnamemodify('../testdir/a', ':t')) call assert_equal('', fnamemodify('.', ':p:t')) -- cgit From 5c09f37d4ac09ce32852b729869c9745d99627ec Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 16 Jan 2018 09:02:11 -0500 Subject: test: fix failed tests with $TMPDIR in QuickBuild --- test/functional/legacy/fnamemodify_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index c1a50387a3..0364316a6a 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -24,11 +24,11 @@ describe('filename modifiers', function() execute 'cd '. tmpdir let $HOME=fnamemodify('.', ':p:h:h:h') call assert_equal('/', fnamemodify('.', ':p')[-1:]) - call assert_equal('p', fnamemodify('.', ':p:h')[-1:]) + call assert_equal(tmpdir[strchars(tmpdir) - 1], 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', ':~')) + call assert_equal(fnamemodify(tmpdir, ':~').'/test.out', fnamemodify('test.out', ':~')) call assert_equal('../testdir/a', fnamemodify('../testdir/a', ':~')) call assert_equal('a', fnamemodify('../testdir/a', ':t')) call assert_equal('', fnamemodify('.', ':p:t')) -- cgit From 0578087e5ec928e89643f97fc0b82ed8363e4e09 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 16 Jan 2018 09:44:26 -0500 Subject: test: osx: try resolve($TMPDIR) --- test/functional/legacy/fnamemodify_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index 0364316a6a..7e859bf0cf 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -19,7 +19,7 @@ describe('filename modifiers', function() else set shell=sh endif - let tmpdir = $TMPDIR + let tmpdir = resolve($TMPDIR) call assert_true(isdirectory(tmpdir)) execute 'cd '. tmpdir let $HOME=fnamemodify('.', ':p:h:h:h') -- cgit From 41b3c7850f839b46affe35bf2de92bc18113b0f7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 29 Jan 2018 00:05:25 -0500 Subject: test: use helpers.pathroot() to avoid a syscall --- test/functional/eval/fnamemodify_spec.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua index 52dfe1a55f..fe6b50a544 100644 --- a/test/functional/eval/fnamemodify_spec.lua +++ b/test/functional/eval/fnamemodify_spec.lua @@ -18,24 +18,18 @@ describe('fnamemodify()', function() end) it('works', function() + local root = helpers.pathroot() + eq(root, fnamemodify([[/]], ':p:h')) + eq(root, fnamemodify([[/]], ':p')) if iswin() then - local drive_f = io.popen('for %P in (%CD%) do @echo %~dP', 'r') - local drive = string.gsub(drive_f:read('*a'), '[\n\r]', '') - drive_f:close() - local root = drive..[[\]] eq(root, fnamemodify([[\]], ':p:h')) eq(root, fnamemodify([[\]], ':p')) - eq(root, fnamemodify([[/]], ':p:h')) - eq(root, fnamemodify([[/]], ':p')) command('set shellslash') - root = drive..[[/]] + root = string.sub(root, 1, -2)..'/' eq(root, fnamemodify([[\]], ':p:h')) eq(root, fnamemodify([[\]], ':p')) eq(root, fnamemodify([[/]], ':p:h')) eq(root, fnamemodify([[/]], ':p')) - else - eq('/', fnamemodify([[/]], ':p:h')) - eq('/', fnamemodify([[/]], ':p')) end end) -- cgit