summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-08 22:27:31 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-08 22:27:31 +0200
commitbfde0b482d25db43e9fc5a35c771b859b1eb8828 (patch)
tree72949612567980cb5f3178847a52153c6bcfc0bf
parent9fa9506853516c82851baec643aa47458cb8b3bc (diff)
downloadvim-git-8.1.0257.tar.gz
patch 8.1.0257: no test for pathshorten()v8.1.0257
Problem: No test for pathshorten(). Solution: Add a test. (Dominique Pelle, closes #3295)
-rw-r--r--src/testdir/test_functions.vim15
-rw-r--r--src/version.c2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 41996bd45..13db0041e 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -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))
diff --git a/src/version.c b/src/version.c
index 8e21e9895..36376e9e5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 257,
+/**/
256,
/**/
255,