summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_cmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-05 14:57:51 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-05 14:57:51 +0200
commite9f262bdff2defa248e5d40b6520251799581ea4 (patch)
tree69ddc804a1b5f7be0ee2b07694739d0e0dd10b6a /src/testdir/test_vim9_cmd.vim
parent3f40ce78f5c178d15871bd784ed878c78f0b8a44 (diff)
patch 8.2.1129: Vim9: bar not recognized after not compiled commandv8.2.1129
Problem: Vim9: bar not recognized after not compiled command. Solution: Check for bar for commands where this is possible. (closes #6391)
Diffstat (limited to 'src/testdir/test_vim9_cmd.vim')
-rw-r--r--src/testdir/test_vim9_cmd.vim34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index 27d2b3a7cd..53d964fa8b 100644
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -2,6 +2,7 @@
source check.vim
source vim9.vim
+source view_util.vim
def Test_edit_wildcards()
let filename = 'Xtest'
@@ -207,5 +208,38 @@ def Test_method_call_linebreak()
CheckScriptSuccess(lines)
enddef
+def Test_bar_after_command()
+ def RedrawAndEcho()
+ let x = 'did redraw'
+ redraw | echo x
+ enddef
+ RedrawAndEcho()
+ assert_match('did redraw', Screenline(&lines))
+
+ if has('unix')
+ # bar in filter write command does not start new command
+ def WriteToShell()
+ new
+ setline(1, 'some text')
+ w !cat | cat > Xoutfile
+ bwipe!
+ enddef
+ WriteToShell()
+ assert_equal(['some text'], readfile('Xoutfile'))
+ delete('Xoutfile')
+
+ # bar in filter read command does not start new command
+ def ReadFromShell()
+ new
+ r! echo hello there | cat > Xoutfile
+ r !echo again | cat >> Xoutfile
+ bwipe!
+ enddef
+ ReadFromShell()
+ assert_equal(['hello there', 'again'], readfile('Xoutfile'))
+ delete('Xoutfile')
+ endif
+enddef
+
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker