mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0257: no test for pathshorten()
Problem: No test for pathshorten().
Solution: Add a test. (Dominique Pelle, closes vim/vim#3295)
bfde0b482d
This commit is contained in:
parent
218fccaba4
commit
6ad8294d5c
@ -239,6 +239,21 @@ func Test_setbufvar_options()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_pathshorten()
|
||||
call assert_equal('', pathshorten(''))
|
||||
call assert_equal('foo', pathshorten('foo'))
|
||||
call assert_equal('/foo', pathshorten('/foo'))
|
||||
call assert_equal('f/', pathshorten('foo/'))
|
||||
call assert_equal('f/bar', pathshorten('foo/bar'))
|
||||
call assert_equal('f/b/foobar', pathshorten('foo/bar/foobar'))
|
||||
call assert_equal('/f/b/foobar', pathshorten('/foo/bar/foobar'))
|
||||
call assert_equal('.f/bar', pathshorten('.foo/bar'))
|
||||
call assert_equal('~f/bar', pathshorten('~foo/bar'))
|
||||
call assert_equal('~.f/bar', pathshorten('~.foo/bar'))
|
||||
call assert_equal('.~f/bar', pathshorten('.~foo/bar'))
|
||||
call assert_equal('~/f/bar', pathshorten('~/foo/bar'))
|
||||
endfunc
|
||||
|
||||
func Test_strpart()
|
||||
call assert_equal('de', strpart('abcdefg', 3, 2))
|
||||
call assert_equal('ab', strpart('abcdefg', -2, 4))
|
||||
|
Loading…
Reference in New Issue
Block a user