48 lines · 952 B · Text
RawDownload
Tests for string and html text objects. vim: set ft=vim : Note that the end-of-line moves the cursor to the next test line. Also test match() and matchstr() STARTTEST:so small.vim/^start:/da"0va'a'rx02f`da`0fXdi"03f'vi'ry:set quoteescape=+*-di`$F"va"oha"i"rz:"/^<beginjfXdit0fXditfXdat0fXdat:":put =matchstr(\"abcd\", \".\", 0, 2) " b:put =matchstr(\"abcd\", \"..\", 0, 2) " bc:put =matchstr(\"abcd\", \".\", 2, 0) " c (zero and negative -> first match):put =matchstr(\"abcd\", \".\", 0, -1) " a:put =match(\"abcd\", \".\", 0, 5) " -1:put =match(\"abcd\", \".\", 0, -1) " 0:/^start:/,/^end:/wq! test.outENDTEST start: "wo\"rd\\" foo'foo' 'bar' 'piep'bla bla `quote` blahout " in "noXno""'" 'blah' rep 'buh'bla `s*`d-`+++`l**` b`lavoo "nah" sdf " asdf" sdf " sdf" sd <begin>-<b>asdf<i>Xasdf</i>asdf</b>--<b>asdX<i>a<i />sdf</i>asdf</b>--<b>asdf<i>Xasdf</i>asdf</b>--<b>asdX<i>as<b />df</i>asdf</b>-</begin>end: