diff --git a/src/testdir/test_textobjects.vim b/src/testdir/test_textobjects.vim index 088b5d2f50..16070b1c8e 100644 --- a/src/testdir/test_textobjects.vim +++ b/src/testdir/test_textobjects.vim @@ -88,101 +88,107 @@ endfunc " Tests for string and html text objects func Test_string_html_objects() - enew! - let t = '"wo\"rd\\" foo' - put =t - normal! da" - call assert_equal('foo', getline('.')) + for e in ['utf-8', 'latin1', 'cp932'] + enew! + exe 'set enc=' .. e - let t = "'foo' 'bar' 'piep'" - put =t - normal! 0va'a'rx - call assert_equal("xxxxxxxxxxxx'piep'", getline('.')) + let t = '"wo\"rd\\" foo' + put =t + normal! da" + call assert_equal('foo', getline('.'), e) - let t = "bla bla `quote` blah" - put =t - normal! 02f`da` - call assert_equal("bla bla blah", getline('.')) + let t = "'foo' 'bar' 'piep'" + put =t + normal! 0va'a'rx + call assert_equal("xxxxxxxxxxxx'piep'", getline('.'), e) - let t = 'out " in "noXno"' - put =t - normal! 0fXdi" - call assert_equal('out " in ""', getline('.')) + let t = "bla bla `quote` blah" + put =t + normal! 02f`da` + call assert_equal("bla bla blah", getline('.'), e) - let t = "\"'\" 'blah' rep 'buh'" - put =t - normal! 03f'vi'ry - call assert_equal("\"'\" 'blah'yyyyy'buh'", getline('.')) + let t = 'out " in "noXno"' + put =t + normal! 0fXdi" + call assert_equal('out " in ""', getline('.'), e) - set quoteescape=+*- - let t = "bla `s*`d-`+++`l**` b`la" - put =t - normal! di` - call assert_equal("bla `` b`la", getline('.')) + let t = "\"'\" 'blah' rep 'buh'" + put =t + normal! 03f'vi'ry + call assert_equal("\"'\" 'blah'yyyyy'buh'", getline('.'), e) - let t = 'voo "nah" sdf " asdf" sdf " sdf" sd' - put =t - normal! $F"va"oha"i"rz - call assert_equal('voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd', getline('.')) + set quoteescape=+*- + let t = "bla `s*`d-`+++`l**` b`la" + put =t + normal! di` + call assert_equal("bla `` b`la", getline('.'), e) - let t = "-asdfXasdfasdf-" - put =t - normal! fXdit - call assert_equal('-asdfasdf-', getline('.')) + let t = 'voo "nah" sdf " asdf" sdf " sdf" sd' + put =t + normal! $F"va"oha"i"rz + call assert_equal('voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd', getline('.'), e) - let t = "-asdXasdfasdf-" - put =t - normal! 0fXdit - call assert_equal('--', getline('.')) + let t = "-asdfXasdfasdf-" + put =t + normal! fXdit + call assert_equal('-asdfasdf-', getline('.'), e) - let t = "-asdfXasdfasdf-" - put =t - normal! fXdat - call assert_equal('-asdfasdf-', getline('.')) + let t = "-asdXasdfasdf-" + put =t + normal! 0fXdit + call assert_equal('--', getline('.'), e) - let t = "-asdXasdfasdf-" - put =t - normal! 0fXdat - call assert_equal('--', getline('.')) + let t = "-asdfXasdfasdf-" + put =t + normal! fXdat + call assert_equal('-asdfasdf-', getline('.'), e) - let t = "-\ninnertext object\n" - put =t - normal! dit - call assert_equal('-', getline('.')) + let t = "-asdXasdfasdf-" + put =t + normal! 0fXdat + call assert_equal('--', getline('.'), e) - " copy the tag block from leading indentation before the start tag - let t = " \ntext\n" - $put =t - normal! 2kvaty - call assert_equal("\ntext\n", @") + let t = "-\ninnertext object\n" + put =t + normal! dit + call assert_equal('-', getline('.'), e) - " copy the tag block from the end tag - let t = "