mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-24 04:56:33 -07:00
b2133cf2ec
Close https://github.com/junegunn/vim-plug/issues/995 Vim supports omitting file extensions for its option. I omitted the file extension in Neovim's documentation for powershell.
42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
Execute (plug#shellescape() works without optional arguments):
|
|
if has('unix')
|
|
AssertEqual "''", plug#shellescape("")
|
|
AssertEqual "'foo'\\'''", plug#shellescape("foo'")
|
|
endif
|
|
|
|
Execute (plug#shellescape() ignores invalid optional argument):
|
|
if has('unix')
|
|
AssertEqual "''", plug#shellescape("", '')
|
|
AssertEqual "'foo'\\'''", plug#shellescape("foo'", [])
|
|
endif
|
|
|
|
Execute (plug#shellescape() depends on the shell):
|
|
AssertEqual "'foo'\\'''", plug#shellescape("foo'", {'shell': 'sh'})
|
|
AssertEqual '^"foo''^"', plug#shellescape("foo'", {'shell': 'cmd.exe'})
|
|
AssertEqual "'foo'''", plug#shellescape("foo'", {'shell': 'powershell'})
|
|
AssertEqual "'foo'''", plug#shellescape("foo'", {'shell': 'powershell.exe'})
|
|
AssertEqual "'foo'''", plug#shellescape("foo'", {'shell': 'pwsh'})
|
|
|
|
Execute (plug#shellescape() supports non-trivial cmd.exe escaping):
|
|
" batchfile
|
|
AssertEqual '^"^^%%PATH^^%%^"', plug#shellescape("^%PATH^%", {
|
|
\ 'shell': 'cmd.exe',
|
|
\ })
|
|
AssertEqual '^"^^%%PATH^^%%^"', plug#shellescape("^%PATH^%", {
|
|
\ 'shell': 'cmd.exe',
|
|
\ 'script': 1,
|
|
\ })
|
|
" command prompt
|
|
AssertEqual '^"^^^%PATH^^^%^"', plug#shellescape("^%PATH^%", {
|
|
\ 'shell': 'cmd.exe',
|
|
\ 'script': 0,
|
|
\ }),
|
|
|
|
Execute (plug#shellescape() supports non-trivial powershell.exe escaping):
|
|
AssertEqual '''\"Foo\\''''\\Bar\"''', plug#shellescape('"Foo\''\Bar"', {
|
|
\ 'shell': 'powershell',
|
|
\ }),
|
|
AssertEqual '''\"Foo\\''''\\Bar\"''', plug#shellescape('"Foo\''\Bar"', {
|
|
\ 'shell': 'powershell.exe',
|
|
\ }),
|