mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.1418: no test for expanding backticks
Problem: No test for expanding backticks. Solution: Add a test. (Dominique Pelle, closes #2479)
This commit is contained in:
parent
1bd999f982
commit
ae6f865125
@ -404,6 +404,15 @@ func! Test_normal10_expand()
|
|||||||
call assert_equal(expected[i], expand('<cexpr>'), 'i == ' . i)
|
call assert_equal(expected[i], expand('<cexpr>'), 'i == ' . i)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
if executable('echo')
|
||||||
|
" Test expand(`...`) i.e. backticks command expansion.
|
||||||
|
" MS-Windows has a trailing space.
|
||||||
|
call assert_match('^abcde *$', expand('`echo abcde`'))
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Test expand(`=...`) i.e. backticks expression expansion
|
||||||
|
call assert_equal('5', expand('`=2+3`'))
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
@ -1537,12 +1546,12 @@ fun! Test_normal29_brace()
|
|||||||
\ 'the ''{'' flag is in ''cpoptions'' then ''{'' in the first column is used as a',
|
\ 'the ''{'' flag is in ''cpoptions'' then ''{'' in the first column is used as a',
|
||||||
\ 'paragraph boundary |posix|.',
|
\ 'paragraph boundary |posix|.',
|
||||||
\ '{',
|
\ '{',
|
||||||
\ 'This is no paragaraph',
|
\ 'This is no paragraph',
|
||||||
\ 'unless the ''{'' is set',
|
\ 'unless the ''{'' is set',
|
||||||
\ 'in ''cpoptions''',
|
\ 'in ''cpoptions''',
|
||||||
\ '}',
|
\ '}',
|
||||||
\ '.IP',
|
\ '.IP',
|
||||||
\ 'The nroff macros IP seperates a paragraph',
|
\ 'The nroff macros IP separates a paragraph',
|
||||||
\ 'That means, it must be a ''.''',
|
\ 'That means, it must be a ''.''',
|
||||||
\ 'followed by IP',
|
\ 'followed by IP',
|
||||||
\ '.LPIt does not matter, if afterwards some',
|
\ '.LPIt does not matter, if afterwards some',
|
||||||
@ -1557,7 +1566,7 @@ fun! Test_normal29_brace()
|
|||||||
1
|
1
|
||||||
norm! 0d2}
|
norm! 0d2}
|
||||||
call assert_equal(['.IP',
|
call assert_equal(['.IP',
|
||||||
\ 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''', 'followed by IP',
|
\ 'The nroff macros IP separates a paragraph', 'That means, it must be a ''.''', 'followed by IP',
|
||||||
\ '.LPIt does not matter, if afterwards some', 'more characters follow.', '.SHAlso section boundaries from the nroff',
|
\ '.LPIt does not matter, if afterwards some', 'more characters follow.', '.SHAlso section boundaries from the nroff',
|
||||||
\ 'macros terminate a paragraph. That means', 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
\ 'macros terminate a paragraph. That means', 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
||||||
norm! 0d}
|
norm! 0d}
|
||||||
@ -1576,21 +1585,21 @@ fun! Test_normal29_brace()
|
|||||||
set cpo+={
|
set cpo+={
|
||||||
1
|
1
|
||||||
norm! 0d2}
|
norm! 0d2}
|
||||||
call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
call assert_equal(['{', 'This is no paragraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
||||||
\ '.IP', 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''',
|
\ '.IP', 'The nroff macros IP separates a paragraph', 'That means, it must be a ''.''',
|
||||||
\ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.',
|
\ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.',
|
||||||
\ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means',
|
\ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means',
|
||||||
\ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
\ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
||||||
$
|
$
|
||||||
norm! d}
|
norm! d}
|
||||||
call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
call assert_equal(['{', 'This is no paragraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
||||||
\ '.IP', 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''',
|
\ '.IP', 'The nroff macros IP separates a paragraph', 'That means, it must be a ''.''',
|
||||||
\ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.',
|
\ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.',
|
||||||
\ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means',
|
\ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means',
|
||||||
\ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
\ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
||||||
norm! gg}
|
norm! gg}
|
||||||
norm! d5}
|
norm! d5}
|
||||||
call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}', ''], getline(1,'$'))
|
call assert_equal(['{', 'This is no paragraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}', ''], getline(1,'$'))
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
set cpo-={
|
set cpo-={
|
||||||
|
@ -771,6 +771,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1418,
|
||||||
/**/
|
/**/
|
||||||
1417,
|
1417,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user