summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_functions.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-04 20:05:59 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-04 20:05:59 +0200
commit3f4f3d8e7e6fc0494d00cfb75669a554c8e67c8b (patch)
treeac8bdd089ce9a96e2e96033410b88b1836425a28 /src/testdir/test_functions.vim
parentea781459b9617aa47335061fcc78403495260315 (diff)
patch 8.1.1984: more functions can be used as methodsv8.1.1984
Problem: More functions can be used as methods. Solution: Make various functions usable as a method.
Diffstat (limited to 'src/testdir/test_functions.vim')
-rw-r--r--src/testdir/test_functions.vim14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index d5ce5f02bf..fc22bcd320 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -400,10 +400,10 @@ endfunc
func Test_pathshorten()
call assert_equal('', pathshorten(''))
call assert_equal('foo', pathshorten('foo'))
- call assert_equal('/foo', pathshorten('/foo'))
+ call assert_equal('/foo', '/foo'->pathshorten())
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', 'foo/bar/foobar'->pathshorten())
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'))
@@ -847,21 +847,21 @@ Test
call assert_equal(0, nextnonblank(-1))
call assert_equal(0, nextnonblank(0))
call assert_equal(1, nextnonblank(1))
- call assert_equal(4, nextnonblank(2))
+ call assert_equal(4, 2->nextnonblank())
call assert_equal(4, nextnonblank(3))
call assert_equal(4, nextnonblank(4))
call assert_equal(6, nextnonblank(5))
call assert_equal(6, nextnonblank(6))
call assert_equal(7, nextnonblank(7))
- call assert_equal(0, nextnonblank(8))
+ call assert_equal(0, 8->nextnonblank())
call assert_equal(0, prevnonblank(-1))
call assert_equal(0, prevnonblank(0))
- call assert_equal(1, prevnonblank(1))
+ call assert_equal(1, 1->prevnonblank())
call assert_equal(1, prevnonblank(2))
call assert_equal(1, prevnonblank(3))
call assert_equal(4, prevnonblank(4))
- call assert_equal(4, prevnonblank(5))
+ call assert_equal(4, 5->prevnonblank())
call assert_equal(6, prevnonblank(6))
call assert_equal(7, prevnonblank(7))
call assert_equal(0, prevnonblank(8))
@@ -1220,7 +1220,7 @@ func Test_trim()
call assert_equal("a", trim("a", ""))
call assert_equal("", trim("", "a"))
- let chars = join(map(range(1, 0x20) + [0xa0], {n -> nr2char(n)}), '')
+ let chars = join(map(range(1, 0x20) + [0xa0], {n -> n->nr2char()}), '')
call assert_equal("x", trim(chars . "x" . chars))
endfunc