0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.0257: no test for pathshorten()

Problem:    No test for pathshorten().
Solution:   Add a test. (Dominique Pelle, closes #3295)
This commit is contained in:
Bram Moolenaar
2018-08-08 22:27:31 +02:00
parent 9fa9506853
commit bfde0b482d
2 changed files with 17 additions and 0 deletions

View File

@@ -208,6 +208,21 @@ func Test_simplify()
call assert_fails('call simplify(1.2)', 'E806:') call assert_fails('call simplify(1.2)', 'E806:')
endfunc 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() func Test_strpart()
call assert_equal('de', strpart('abcdefg', 3, 2)) call assert_equal('de', strpart('abcdefg', 3, 2))
call assert_equal('ab', strpart('abcdefg', -2, 4)) call assert_equal('ab', strpart('abcdefg', -2, 4))

View File

@@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
257,
/**/ /**/
256, 256,
/**/ /**/