diff src/testdir/test_match.vim @ 17930:0cdb6ac20748 v8.1.1961

patch 8.1.1961: more functions can be used as a method Commit: https://github.com/vim/vim/commit/a1449836334355b1fb00cd1bf083e7d353f6c4d7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 1 20:16:52 2019 +0200 patch 8.1.1961: more functions can be used as a method Problem: More functions can be used as a method. Solution: Allow more functions to be used as a method. Add a test for mapcheck().
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Sep 2019 20:30:04 +0200
parents f71ee7b04f0b
children 2ade39e58400
line wrap: on
line diff
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -15,7 +15,7 @@ function Test_match()
   2match MyGroup2 /FIXME/
   3match MyGroup3 /XXX/
   call assert_equal(['MyGroup1', 'TODO'], matcharg(1))
-  call assert_equal(['MyGroup2', 'FIXME'], matcharg(2))
+  call assert_equal(['MyGroup2', 'FIXME'], 2->matcharg())
   call assert_equal(['MyGroup3', 'XXX'], matcharg(3))
 
   " --- Check that "matcharg()" returns an empty list if the argument is not 1,
@@ -44,7 +44,7 @@ function Test_match()
   " --- Check that "matchdelete()" deletes the matches defined in the previous
   " --- test correctly.
   call matchdelete(m1)
-  call matchdelete(m2)
+  eval m2->matchdelete()
   call matchdelete(m3)
   call assert_equal([], getmatches())
 
@@ -56,7 +56,7 @@ function Test_match()
   " --- Check that "clearmatches()" clears all matches defined by ":match" and
   " --- "matchadd()".
   let m1 = matchadd("MyGroup1", "TODO")
-  let m2 = matchadd("MyGroup2", "FIXME", 42)
+  let m2 = "MyGroup2"->matchadd("FIXME", 42)
   let m3 = matchadd("MyGroup3", "XXX", 60, 17)
   match MyGroup1 /COFFEE/
   2match MyGroup2 /HUMPPA/
@@ -118,7 +118,7 @@ function Test_match()
   call clearmatches()
 
   call setline(1, 'abcdΣabcdef')
-  call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
+  eval "MyGroup1"->matchaddpos([[1, 4, 2], [1, 9, 2]])
   1
   redraw!
   let v1 = screenattr(1, 1)