comparison src/testdir/test_cmdline.vim @ 31020:b0596e8ee3c0 v9.0.0845

patch 9.0.0845: shell command with just space gives strange error Commit: https://github.com/vim/vim/commit/4e7590ec00483077daaa567aa2220bc8df912f3c Author: shane.xb.qian <shane.qian@foxmail.com> Date: Tue Nov 8 21:40:04 2022 +0000 patch 9.0.0845: shell command with just space gives strange error Problem: Shell command with just space gives strange error. Solution: Skip white space at start of the argument. (Christian Brabandt, Shane-XB-Qian, closes #11515, closes #11495)
author Bram Moolenaar <Bram@vim.org>
date Tue, 08 Nov 2022 22:45:04 +0100
parents 15ac28c12c8f
children a6b1f1c22374
comparison
equal deleted inserted replaced
31019:3cee244c9363 31020:b0596e8ee3c0
1648 call assert_fails('2,3!echo "x"', 'E135:') 1648 call assert_fails('2,3!echo "x"', 'E135:')
1649 1649
1650 augroup test_cmd_filter_E135 1650 augroup test_cmd_filter_E135
1651 au! 1651 au!
1652 augroup END 1652 augroup END
1653 %bwipe!
1654 endfunc
1655
1656 func Test_cmd_bang_args()
1657 new
1658 :.!
1659 call assert_equal(0, v:shell_error)
1660
1661 " Note that below there is one space char after the '!'. This caused a
1662 " shell error in the past, see https://github.com/vim/vim/issues/11495.
1663 :.!
1664 call assert_equal(0, v:shell_error)
1665 bwipe!
1666
1667 CheckUnix
1668 :.!pwd
1669 call assert_equal(0, v:shell_error)
1670 :.! pwd
1671 call assert_equal(0, v:shell_error)
1672
1673 " Note there is one space after 'pwd'.
1674 :.! pwd
1675 call assert_equal(0, v:shell_error)
1676
1677 " Note there are two spaces after 'pwd'.
1678 :.! pwd
1679 call assert_equal(0, v:shell_error)
1680 :.!ls ~
1681 call assert_equal(0, v:shell_error)
1682
1683 " Note there is one space char after '~'.
1684 :.!ls ~
1685 call assert_equal(0, v:shell_error)
1686
1687 " Note there are two spaces after '~'.
1688 :.!ls ~
1689 call assert_equal(0, v:shell_error)
1690
1691 :.!echo "foo"
1692 call assert_equal(getline('.'), "foo")
1693 :.!echo "foo "
1694 call assert_equal(getline('.'), "foo ")
1695 :.!echo " foo "
1696 call assert_equal(getline('.'), " foo ")
1697 :.!echo " foo "
1698 call assert_equal(getline('.'), " foo ")
1699
1653 %bwipe! 1700 %bwipe!
1654 endfunc 1701 endfunc
1655 1702
1656 " Test for using ~ for home directory in cmdline completion matches 1703 " Test for using ~ for home directory in cmdline completion matches
1657 func Test_cmdline_expand_home() 1704 func Test_cmdline_expand_home()