Mercurial > vim
comparison src/testdir/test_substitute.vim @ 15406:63b02fcf1361 v8.1.0711
patch 8.1.0711: test files still use function!
commit https://github.com/vim/vim/commit/1e1153600c0377472d62cc553173fe555ddcf5a7
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 9 23:01:02 2019 +0100
patch 8.1.0711: test files still use function!
Problem: Test files still use function!.
Solution: Remove the exclamation mark. Fix overwriting a function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Jan 2019 23:15:05 +0100 |
parents | aa658b33f25a |
children | aa80c63f34bb |
comparison
equal
deleted
inserted
replaced
15405:3a8785d45112 | 15406:63b02fcf1361 |
---|---|
1 " Tests for multi-line regexps with ":s". | 1 " Tests for multi-line regexps with ":s". |
2 | 2 |
3 function! Test_multiline_subst() | 3 func Test_multiline_subst() |
4 enew! | 4 enew! |
5 call append(0, ["1 aa", | 5 call append(0, ["1 aa", |
6 \ "bb", | 6 \ "bb", |
7 \ "cc", | 7 \ "cc", |
8 \ "2 dd", | 8 \ "2 dd", |
36 call assert_equal('9xd', getline(10)) | 36 call assert_equal('9xd', getline(10)) |
37 call assert_equal('6 ex7', getline(11)) | 37 call assert_equal('6 ex7', getline(11)) |
38 call assert_equal('7x7f', getline(12)) | 38 call assert_equal('7x7f', getline(12)) |
39 call assert_equal('xxxxx', getline(13)) | 39 call assert_equal('xxxxx', getline(13)) |
40 enew! | 40 enew! |
41 endfunction | 41 endfunc |
42 | 42 |
43 function! Test_substitute_variants() | 43 func Test_substitute_variants() |
44 " Validate that all the 2-/3-letter variants which embed the flags into the | 44 " Validate that all the 2-/3-letter variants which embed the flags into the |
45 " command name actually work. | 45 " command name actually work. |
46 enew! | 46 enew! |
47 let ln = 'Testing string' | 47 let ln = 'Testing string' |
48 let variants = [ | 48 let variants = [ |
103 " No error should exist (matters for testing e flag) | 103 " No error should exist (matters for testing e flag) |
104 call assert_equal('', v:errmsg, msg) | 104 call assert_equal('', v:errmsg, msg) |
105 call assert_equal(var.exp, getline('.'), msg) | 105 call assert_equal(var.exp, getline('.'), msg) |
106 endfor | 106 endfor |
107 endfor | 107 endfor |
108 endfunction | 108 endfunc |
109 | 109 |
110 func Test_substitute_repeat() | 110 func Test_substitute_repeat() |
111 " This caused an invalid memory access. | 111 " This caused an invalid memory access. |
112 split Xfile | 112 split Xfile |
113 s/^/x | 113 s/^/x |
399 set magic& | 399 set magic& |
400 set cpo& | 400 set cpo& |
401 | 401 |
402 " List entry format: [input, cmd, output] | 402 " List entry format: [input, cmd, output] |
403 let tests = [ ['aAa', "s/A/\\=substitute(submatch(0), '.', '\\', '')/", | 403 let tests = [ ['aAa', "s/A/\\=substitute(submatch(0), '.', '\\', '')/", |
404 \ ['a\a']], | 404 \ ['a\a']], |
405 \ ['bBb', "s/B/\\=substitute(submatch(0), '.', '\\', '')/", | 405 \ ['bBb', "s/B/\\=substitute(submatch(0), '.', '\\', '')/", |
406 \ ['b\b']], | 406 \ ['b\b']], |
407 \ ['cCc', "s/C/\\=substitute(submatch(0), '.', '\<C-V>\<C-M>', '')/", | 407 \ ['cCc', "s/C/\\=substitute(submatch(0), '.', '\<C-V>\<C-M>', '')/", |
408 \ ["c\<C-V>", 'c']], | 408 \ ["c\<C-V>", 'c']], |
409 \ ['dDd', "s/D/\\=substitute(submatch(0), '.', '\\\<C-V>\<C-M>', '')/", | 409 \ ['dDd', "s/D/\\=substitute(submatch(0), '.', '\\\<C-V>\<C-M>', '')/", |
410 \ ["d\<C-V>", 'd']], | 410 \ ["d\<C-V>", 'd']], |
411 \ ['eEe', "s/E/\\=substitute(submatch(0), '.', '\\\\\<C-V>\<C-M>', '')/", | 411 \ ['eEe', "s/E/\\=substitute(submatch(0), '.', '\\\\\<C-V>\<C-M>', '')/", |