aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-06 21:19:12 +0800
committerGitHub <noreply@github.com>2024-08-06 21:19:12 +0800
commit37952bf7b442cac794c4663f2e0123e7d72bc443 (patch)
treeae4330a07d6b1c0635d61d64f4e22d61901e6de1 /test
parent28fbba2092adb9659253434605cb94252241f5e0 (diff)
downloadrneovim-37952bf7b442cac794c4663f2e0123e7d72bc443.tar.gz
rneovim-37952bf7b442cac794c4663f2e0123e7d72bc443.tar.bz2
rneovim-37952bf7b442cac794c4663f2e0123e7d72bc443.zip
vim-patch:8.2.4838: checking for absolute path is not trivial (#29990)
Problem: Checking for absolute path is not trivial. Solution: Add isabsolutepath(). (closes vim/vim#10303) https://github.com/vim/vim/commit/dca1d40cd0f2af0755519e7028378bd3c8fefd31 vim-patch:8a3b805c6c9c Co-authored-by: LemonBoy <thatlemon@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_functions.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim
index 01e9ae3bf2..29bec72f2b 100644
--- a/test/old/testdir/test_functions.vim
+++ b/test/old/testdir/test_functions.vim
@@ -3559,6 +3559,24 @@ func Test_builtin_check()
unlet bar
endfunc
+" Test for isabsolutepath()
+func Test_isabsolutepath()
+ call assert_false(isabsolutepath(''))
+ call assert_false(isabsolutepath('.'))
+ call assert_false(isabsolutepath('../Foo'))
+ call assert_false(isabsolutepath('Foo/'))
+ if has('win32')
+ call assert_true(isabsolutepath('A:\'))
+ call assert_true(isabsolutepath('A:\Foo'))
+ call assert_true(isabsolutepath('A:/Foo'))
+ call assert_false(isabsolutepath('A:Foo'))
+ call assert_false(isabsolutepath('\Windows'))
+ call assert_true(isabsolutepath('\\Server2\Share\Test\Foo.txt'))
+ else
+ call assert_true(isabsolutepath('/'))
+ call assert_true(isabsolutepath('/usr/share/'))
+ endif
+endfunc
" Test for virtcol()
func Test_virtcol()