Skip to content

Commit bfde0b4

Browse files
committed
patch 8.1.0257: no test for pathshorten()
Problem: No test for pathshorten(). Solution: Add a test. (Dominique Pelle, closes #3295)
1 parent 9fa9506 commit bfde0b4

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/testdir/test_functions.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,21 @@ func Test_simplify()
208208
call assert_fails('call simplify(1.2)', 'E806:')
209209
endfunc
210210

211+
func Test_pathshorten()
212+
call assert_equal('', pathshorten(''))
213+
call assert_equal('foo', pathshorten('foo'))
214+
call assert_equal('/foo', pathshorten('/foo'))
215+
call assert_equal('f/', pathshorten('foo/'))
216+
call assert_equal('f/bar', pathshorten('foo/bar'))
217+
call assert_equal('f/b/foobar', pathshorten('foo/bar/foobar'))
218+
call assert_equal('/f/b/foobar', pathshorten('/foo/bar/foobar'))
219+
call assert_equal('.f/bar', pathshorten('.foo/bar'))
220+
call assert_equal('~f/bar', pathshorten('~foo/bar'))
221+
call assert_equal('~.f/bar', pathshorten('~.foo/bar'))
222+
call assert_equal('.~f/bar', pathshorten('.~foo/bar'))
223+
call assert_equal('~/f/bar', pathshorten('~/foo/bar'))
224+
endfunc
225+
211226
func Test_strpart()
212227
call assert_equal('de', strpart('abcdefg', 3, 2))
213228
call assert_equal('ab', strpart('abcdefg', -2, 4))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ static char *(features[]) =
794794

795795
static int included_patches[] =
796796
{ /* Add new patch number below this line */
797+
/**/
798+
257,
797799
/**/
798800
256,
799801
/**/

0 commit comments

Comments
 (0)