Mercurial > vim
comparison src/testdir/test_options.vim @ 28800:fea88e555652 v8.2.4924
patch 8.2.4924: maparg() may return a string that cannot be reused
Commit: https://github.com/vim/vim/commit/0519ce00394474055bd58c089ea90a19986443eb
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon May 9 12:16:19 2022 +0100
patch 8.2.4924: maparg() may return a string that cannot be reused
Problem: maparg() may return a string that cannot be reused.
Solution: use msg_outtrans_special() instead of str2special().
(closes #10384)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 09 May 2022 13:30:03 +0200 |
parents | fd5942a62312 |
children | b93668df9160 |
comparison
equal
deleted
inserted
replaced
28799:6f38b93c8683 | 28800:fea88e555652 |
---|---|
44 func Test_isfname() | 44 func Test_isfname() |
45 " This used to cause Vim to access uninitialized memory. | 45 " This used to cause Vim to access uninitialized memory. |
46 set isfname= | 46 set isfname= |
47 call assert_equal("~X", expand("~X")) | 47 call assert_equal("~X", expand("~X")) |
48 set isfname& | 48 set isfname& |
49 endfunc | |
50 | |
51 " Test for getting the value of 'pastetoggle' | |
52 func Test_pastetoggle() | |
53 " character with K_SPECIAL byte | |
54 let &pastetoggle = '…' | |
55 call assert_equal('…', &pastetoggle) | |
56 call assert_equal("\n pastetoggle=…", execute('set pastetoggle?')) | |
57 | |
58 " modified character with K_SPECIAL byte | |
59 let &pastetoggle = '<M-…>' | |
60 call assert_equal('<M-…>', &pastetoggle) | |
61 call assert_equal("\n pastetoggle=<M-…>", execute('set pastetoggle?')) | |
62 | |
63 " illegal bytes | |
64 let str = ":\x7f:\x80:\x90:\xd0:" | |
65 let &pastetoggle = str | |
66 call assert_equal(str, &pastetoggle) | |
67 call assert_equal("\n pastetoggle=" .. strtrans(str), execute('set pastetoggle?')) | |
68 unlet str | |
49 endfunc | 69 endfunc |
50 | 70 |
51 func Test_wildchar() | 71 func Test_wildchar() |
52 " Empty 'wildchar' used to access invalid memory. | 72 " Empty 'wildchar' used to access invalid memory. |
53 call assert_fails('set wildchar=', 'E521:') | 73 call assert_fails('set wildchar=', 'E521:') |