blob: 29f7a70bdf2e6bf08bcf2f409cab0fbf5413699f [file] [log] [blame]
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001Tests for string text objects. vim: set ft=vim :
2
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 Moolenaar89cb5e02004-07-19 20:55:54 +000018k:put =matchstr(\"abcd\", \".\", 0, 2) " b
19:put =matchstr(\"abcd\", \"..\", 0, 2) " bc
20:put =matchstr(\"abcd\", \".\", 2, 0) " c (zero and negative -> first match)
21:put =matchstr(\"abcd\", \".\", 0, -1) " a
22:put =match(\"abcd\", \".\", 0, 5) " -1
23:put =match(\"abcd\", \".\", 0, -1) " 0
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +000024:/^start:/,/^end:/wq! test.out
25ENDTEST
26
27start: "wo\"rd\\" foo
28'foo' 'bar' 'piep'
29bla bla `quote` blah
30out " in "noXno"
31"'" 'blah' rep 'buh'
32bla `s*`d-`+++`l**` b`la
33voo "nah" sdf " asdf" sdf " sdf" sd
34end: