Mercurial > vim
comparison src/testdir/test_functions.vim @ 28629:5ef46b938c6e v8.2.4838
patch 8.2.4838: checking for absolute path is not trivial
Commit: https://github.com/vim/vim/commit/dca1d40cd0f2af0755519e7028378bd3c8fefd31
Author: LemonBoy <thatlemon@gmail.com>
Date: Thu Apr 28 15:26:33 2022 +0100
patch 8.2.4838: checking for absolute path is not trivial
Problem: Checking for absolute path is not trivial.
Solution: Add isabsolutepath(). (closes https://github.com/vim/vim/issues/10303)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 28 Apr 2022 16:30:03 +0200 |
parents | 0390c4848b27 |
children | 53c608c7ea9e |
comparison
equal
deleted
inserted
replaced
28628:5cb27da6a351 | 28629:5ef46b938c6e |
---|---|
2885 func Test_funcref_to_string() | 2885 func Test_funcref_to_string() |
2886 let Fn = funcref('g:Test_funcref_to_string') | 2886 let Fn = funcref('g:Test_funcref_to_string') |
2887 call assert_equal("function('g:Test_funcref_to_string')", string(Fn)) | 2887 call assert_equal("function('g:Test_funcref_to_string')", string(Fn)) |
2888 endfunc | 2888 endfunc |
2889 | 2889 |
2890 " Test for isabsolutepath() | |
2891 func Test_isabsolutepath() | |
2892 call assert_false(isabsolutepath('')) | |
2893 call assert_false(isabsolutepath('.')) | |
2894 call assert_false(isabsolutepath('../Foo')) | |
2895 call assert_false(isabsolutepath('Foo/')) | |
2896 if has('win32') | |
2897 call assert_true(isabsolutepath('A:\')) | |
2898 call assert_true(isabsolutepath('A:\Foo')) | |
2899 call assert_true(isabsolutepath('A:/Foo')) | |
2900 call assert_false(isabsolutepath('A:Foo')) | |
2901 call assert_false(isabsolutepath('\Windows')) | |
2902 call assert_true(isabsolutepath('\\Server2\Share\Test\Foo.txt')) | |
2903 else | |
2904 call assert_true(isabsolutepath('/')) | |
2905 call assert_true(isabsolutepath('/usr/share/')) | |
2906 endif | |
2907 endfunc | |
2890 | 2908 |
2891 " vim: shiftwidth=2 sts=2 expandtab | 2909 " vim: shiftwidth=2 sts=2 expandtab |