Mercurial > vim
annotate src/testdir/test_searchpos.vim @ 33838:48299a9c33e3 v9.0.2131
patch 9.0.2131: not all nushell files detected
Commit: https://github.com/vim/vim/commit/b9efc72c2432f2d2a633c12d3a5b9fc3efb7b6e7
Author: Daniel Buch Hansen <boogiewasthere@gmail.com>
Date: Mon Nov 27 20:00:56 2023 +0100
patch 9.0.2131: not all nushell files detected
Problem: not all nushell files detected
Solution: use *.nu to detect nushell files
closes: #13586
Signed-off-by: Daniel Buch Hansen <boogiewasthere@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 27 Nov 2023 20:15:04 +0100 |
parents | 08940efa6b4e |
children |
rev | line source |
---|---|
7358
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for searchpos() |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_searchpos() |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 new one |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 0put ='1a3' |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 1put ='123xyz' |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call cursor(1, 1) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal([1, 1, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW')) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call cursor(1, 2) |
17994
0dcc2ee838dd
patch 8.1.1993: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
7586
diff
changeset
|
10 call assert_equal([2, 1, 1], '\%(\([a-z]\)\|\_.\)\{-}xyz'->searchpos('pcW')) |
7358
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 set cpo-=c |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call cursor(1, 2) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal([1, 2, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW')) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call cursor(1, 3) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal([1, 3, 1], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW')) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 " Now with \zs, first match is in column 0, "a" is matched. |
7586
9fc996244059
commit https://github.com/vim/vim/commit/24c4d539eed33e8073f8f9fe2bee497bbba935a4
Christian Brabandt <cb@256bit.org>
parents:
7358
diff
changeset
|
18 call cursor(1, 3) |
7358
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal([2, 4, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}\zsxyz', 'pcW')) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 " With z flag start at cursor column, don't see the "a". |
7586
9fc996244059
commit https://github.com/vim/vim/commit/24c4d539eed33e8073f8f9fe2bee497bbba935a4
Christian Brabandt <cb@256bit.org>
parents:
7358
diff
changeset
|
21 call cursor(1, 3) |
7358
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal([2, 4, 1], searchpos('\%(\([a-z]\)\|\_.\)\{-}\zsxyz', 'pcWz')) |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 set cpo+=c |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 " close the window |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 q! |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 |
6fbeef3b65e6
commit https://github.com/vim/vim/commit/ad4d8a192abf44b89371af87d70b971cd654b799
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
29 |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
30 " vim: shiftwidth=2 sts=2 expandtab |