853
|
1 Tests for string and html text objects. vim: set ft=vim :
|
12
|
2
|
19
|
3 Note that the end-of-line moves the cursor to the next test line.
|
|
4
|
|
5 Also test match() and matchstr()
|
|
6
|
12
|
7 STARTTEST
|
|
8 :so small.vim
|
|
9 /^start:/
|
|
10 da"
|
|
11 0va'a'rx
|
|
12 02f`da`
|
|
13 0fXdi"
|
|
14 03f'vi'ry
|
|
15 :set quoteescape=+*-
|
|
16 di`
|
|
17 $F"va"oha"i"rz
|
853
|
18 :"
|
|
19 /^<begin
|
|
20 jfXdit
|
|
21 0fXdit
|
|
22 fXdat
|
|
23 0fXdat
|
|
24 :"
|
|
25 :put =matchstr(\"abcd\", \".\", 0, 2) " b
|
19
|
26 :put =matchstr(\"abcd\", \"..\", 0, 2) " bc
|
|
27 :put =matchstr(\"abcd\", \".\", 2, 0) " c (zero and negative -> first match)
|
|
28 :put =matchstr(\"abcd\", \".\", 0, -1) " a
|
|
29 :put =match(\"abcd\", \".\", 0, 5) " -1
|
|
30 :put =match(\"abcd\", \".\", 0, -1) " 0
|
3701
|
31 /^foobar
|
|
32 gncsearchmatch/one\_s*two\_s
|
|
33 :1
|
|
34 gnd
|
|
35 /[a]bcdx
|
|
36 :1
|
|
37 2gnd
|
12
|
38 :/^start:/,/^end:/wq! test.out
|
|
39 ENDTEST
|
|
40
|
|
41 start: "wo\"rd\\" foo
|
|
42 'foo' 'bar' 'piep'
|
|
43 bla bla `quote` blah
|
|
44 out " in "noXno"
|
|
45 "'" 'blah' rep 'buh'
|
|
46 bla `s*`d-`+++`l**` b`la
|
|
47 voo "nah" sdf " asdf" sdf " sdf" sd
|
853
|
48
|
|
49 <begin>
|
|
50 -<b>asdf<i>Xasdf</i>asdf</b>-
|
|
51 -<b>asdX<i>a<i />sdf</i>asdf</b>-
|
|
52 -<b>asdf<i>Xasdf</i>asdf</b>-
|
|
53 -<b>asdX<i>as<b />df</i>asdf</b>-
|
|
54 </begin>
|
3701
|
55 SEARCH:
|
|
56 foobar
|
|
57 one
|
|
58 two
|
|
59 abcdx | abcdx | abcdx
|
12
|
60 end:
|