diff options
| author | Hinidu <hinidu@gmail.com> | 2014-04-04 21:00:51 +0300 |
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-08 13:36:16 -0300 |
| commit | f826b4c616961450307b2a88763b0b48dfa44524 (patch) | |
| tree | f9c0956f568c9dea6f451e712bf254b222e8c855 /src/testdir | |
| parent | 10f899e8e716a7d3c484cf295b962869b7dc3bb6 (diff) | |
| download | rneovim-f826b4c616961450307b2a88763b0b48dfa44524.tar.gz rneovim-f826b4c616961450307b2a88763b0b48dfa44524.tar.bz2 rneovim-f826b4c616961450307b2a88763b0b48dfa44524.zip | |
vim-patch:7.4.184
Problem: match() does not work properly with a {count} argument.
Solution: Compute the length once and update it. Quit the loop when at the
end. (Hirohito Higashi)
https://code.google.com/p/vim/source/detail?r=9ac2fc63501d3eff92446c03b2822b30b169db5a
Diffstat (limited to 'src/testdir')
| -rw-r--r-- | src/testdir/test53.in | 39 | ||||
| -rw-r--r-- | src/testdir/test53.ok | 31 |
2 files changed, 70 insertions, 0 deletions
diff --git a/src/testdir/test53.in b/src/testdir/test53.in index 47cf6f562f..011c9ae39d 100644 --- a/src/testdir/test53.in +++ b/src/testdir/test53.in @@ -4,6 +4,8 @@ Note that the end-of-line moves the cursor to the next test line. Also test match() and matchstr() +Also test the gn command and repeating it. + STARTTEST :so small.vim /^start:/ @@ -28,6 +30,28 @@ fXdat :put =matchstr(\"abcd\", \".\", 0, -1) " a :put =match(\"abcd\", \".\", 0, 5) " -1 :put =match(\"abcd\", \".\", 0, -1) " 0 +:put =match('abc', '.', 0, 1) " 0 +:put =match('abc', '.', 0, 2) " 1 +:put =match('abc', '.', 0, 3) " 2 +:put =match('abc', '.', 0, 4) " -1 +:put =match('abc', '.', 1, 1) " 1 +:put =match('abc', '.', 2, 1) " 2 +:put =match('abc', '.', 3, 1) " -1 +:put =match('abc', '$', 0, 1) " 3 +:put =match('abc', '$', 0, 2) " -1 +:put =match('abc', '$', 1, 1) " 3 +:put =match('abc', '$', 2, 1) " 3 +:put =match('abc', '$', 3, 1) " 3 +:put =match('abc', '$', 4, 1) " -1 +:put =match('abc', '\zs', 0, 1) " 0 +:put =match('abc', '\zs', 0, 2) " 1 +:put =match('abc', '\zs', 0, 3) " 2 +:put =match('abc', '\zs', 0, 4) " 3 +:put =match('abc', '\zs', 0, 5) " -1 +:put =match('abc', '\zs', 1, 1) " 1 +:put =match('abc', '\zs', 2, 1) " 2 +:put =match('abc', '\zs', 3, 1) " 3 +:put =match('abc', '\zs', 4, 1) " -1 /^foobar gncsearchmatch/one\_s*two\_s :1 @@ -49,6 +73,12 @@ cgnj :" Make sure there is no other match y uppercase. /x59 gggnd +:" test repeating dgn +/^Johnny +ggdgn. +:" test repeating gUgn +/^Depp +gggUgn. :/^start:/,/^end:/wq! test.out ENDTEST @@ -81,4 +111,13 @@ for (i=0; i<=10; i++) Y text Y +--1 +Johnny +--2 +Johnny +--3 +Depp +--4 +Depp +--5 end: diff --git a/src/testdir/test53.ok b/src/testdir/test53.ok index e469869abb..d7ffa6bc51 100644 --- a/src/testdir/test53.ok +++ b/src/testdir/test53.ok @@ -18,6 +18,28 @@ c a -1 0 +0 +1 +2 +-1 +1 +2 +-1 +3 +-1 +3 +3 +3 +-1 +0 +1 +2 +3 +-1 +1 +2 +3 +-1 SEARCH: searchmatch abcdx | | abcdx @@ -30,4 +52,13 @@ for (j=0; i<=10; i++) text Y +--1 + +--2 + +--3 +DEPP +--4 +DEPP +--5 end: |