diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-01 12:28:16 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-10-03 20:12:20 +0100 |
commit | c5583df3c081e485b521570891dbdd16cd952a85 (patch) | |
tree | aa6267bea0e5a4b20daf263228f7e60af9351223 /src/nvim/testdir/test_functions.vim | |
parent | d23d37b212d7b47ae1f729de5e0ea46b456ad2e5 (diff) | |
download | rneovim-c5583df3c081e485b521570891dbdd16cd952a85.tar.gz rneovim-c5583df3c081e485b521570891dbdd16cd952a85.tar.bz2 rneovim-c5583df3c081e485b521570891dbdd16cd952a85.zip |
vim-patch:8.1.1984: more functions can be used as methods
Problem: More functions can be used as methods.
Solution: Make various functions usable as a method.
https://github.com/vim/vim/commit/3f4f3d8e7e6fc0494d00cfb75669a554c8e67c8b
test_prompt_buffer.vim already had all the changes, except
Test_prompt_garbage_collect().
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index d4da8dde40..c08b43736b 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -360,10 +360,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')) @@ -869,21 +869,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)) @@ -1292,7 +1292,7 @@ func Test_trim() call assert_fails('call trim(" vim ", " ", -1)', 'E475:') call assert_fails('call trim(" vim ", " ", 3)', 'E475:') - 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 |