]> granicus.if.org Git - vim/commitdiff
patch 8.1.0257: no test for pathshorten() v8.1.0257
authorBram Moolenaar <Bram@vim.org>
Wed, 8 Aug 2018 20:27:31 +0000 (22:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 8 Aug 2018 20:27:31 +0000 (22:27 +0200)
Problem:    No test for pathshorten().
Solution:   Add a test. (Dominique Pelle, closes #3295)

src/testdir/test_functions.vim
src/version.c

index 41996bd451599abe1b41923a7f5e281a8cd703f5..13db0041e7036ef9f8b25b55c1f9aa93b769900e 100644 (file)
@@ -208,6 +208,21 @@ func Test_simplify()
   call assert_fails('call simplify(1.2)', 'E806:')
 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))
index 8e21e9895279382619667f327d1043c8bd86a755..36376e9e5df986bfe377539111809db77b76eabf 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    257,
 /**/
     256,
 /**/