blob: cc333c7a1f3afbe74026c8bf8e43d475eb429ee1 [file] [log] [blame]
Bram Moolenaar06a89a52006-04-29 22:01:03 +00001Tests for string and html text objects. vim: set ft=vim :
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00003Note that the end-of-line moves the cursor to the next test line.
4
5Also test match() and matchstr()
6
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00007STARTTEST
8:so small.vim
9/^start:/
10da"
110va'a'rx
1202f`da`
130fXdi"
1403f'vi'ry
15:set quoteescape=+*-
16di`
17$F"va"oha"i"rz
Bram Moolenaar06a89a52006-04-29 22:01:03 +000018:"
19/^<begin
20jfXdit
210fXdit
22fXdat
230fXdat
24:"
25:put =matchstr(\"abcd\", \".\", 0, 2) " b
Bram Moolenaar89cb5e02004-07-19 20:55:54 +000026: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
Bram Moolenaar641e2862012-07-25 15:06:34 +020031/^foobar
32gncsearchmatch/one\_s*two\_s
33:1
34gnd
35/[a]bcdx
36:1
372gnd
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +000038:/^start:/,/^end:/wq! test.out
39ENDTEST
40
41start: "wo\"rd\\" foo
42'foo' 'bar' 'piep'
43bla bla `quote` blah
44out " in "noXno"
45"'" 'blah' rep 'buh'
46bla `s*`d-`+++`l**` b`la
47voo "nah" sdf " asdf" sdf " sdf" sd
Bram Moolenaar06a89a52006-04-29 22:01:03 +000048
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>
Bram Moolenaar641e2862012-07-25 15:06:34 +020055SEARCH:
56foobar
57one
58two
59abcdx | abcdx | abcdx
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +000060end: