summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-11-11 01:05:48 +0100
committerBram Moolenaar <Bram@vim.org>2013-11-11 01:05:48 +0100
commitd6b8a5253b293b90a90af4320e9fd1c6e587ad2b (patch)
treeff3b1dc7266f430578284b0d1b43d18a09cdd697 /src/testdir
parenta939e434407b749adf4d50ea9f3f13b6a9abaf86 (diff)
updated for version 7.4.084v7.4.084
Problem: Python: interrupt not being properly discarded. (Yggdroot Chen) Solution: Discard interrupt in VimTryEnd. (ZyX)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test86.in31
-rw-r--r--src/testdir/test86.ok4
-rw-r--r--src/testdir/test87.in31
-rw-r--r--src/testdir/test87.ok4
4 files changed, 70 insertions, 0 deletions
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index 48fa4e5a1d..91f771dcf0 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -1281,6 +1281,37 @@ del Exe
EOF
:delfunction Exe
:"
+:" Regression: interrupting vim.command propagates to next vim.command
+py << EOF
+def test_keyboard_interrupt():
+ try:
+ vim.command('while 1 | endwhile')
+ except KeyboardInterrupt:
+ cb.append('Caught KeyboardInterrupt')
+ except Exception:
+ cb.append('!!!!!!!! Caught exception: ' + repr(sys.exc_info))
+ else:
+ cb.append('!!!!!!!! No exception')
+ try:
+ vim.command('$ put =\'Running :put\'')
+ except KeyboardInterrupt:
+ cb.append('!!!!!!!! Caught KeyboardInterrupt')
+ except Exception:
+ cb.append('!!!!!!!! Caught exception: ' + repr(sys.exc_info))
+ else:
+ cb.append('No exception')
+EOF
+:debuggreedy
+:call inputsave()
+:call feedkeys("s\ns\ns\ns\nq\n")
+:redir => output
+:debug silent! py test_keyboard_interrupt()
+:redir END
+:0 debuggreedy
+:silent $put =output
+:unlet output
+:py del test_keyboard_interrupt
+:"
:" Cleanup
py << EOF
del cb
diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok
index 69c98d02d3..2d5b1619e9 100644
--- a/src/testdir/test86.ok
+++ b/src/testdir/test86.ok
@@ -1198,3 +1198,7 @@ vim.eval("Exe('throw ''ghi''')"):error:('ghi',)
vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',)
vim.eval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)
vim.bindeval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)
+Caught KeyboardInterrupt
+Running :put
+No exception
+
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 54cd97748f..899e4f3389 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -1232,6 +1232,37 @@ del Exe
EOF
:delfunction Exe
:"
+:" Regression: interrupting vim.command propagates to next vim.command
+py3 << EOF
+def test_keyboard_interrupt():
+ try:
+ vim.command('while 1 | endwhile')
+ except KeyboardInterrupt:
+ cb.append('Caught KeyboardInterrupt')
+ except Exception as e:
+ cb.append('!!!!!!!! Caught exception: ' + repr(e))
+ else:
+ cb.append('!!!!!!!! No exception')
+ try:
+ vim.command('$ put =\'Running :put\'')
+ except KeyboardInterrupt:
+ cb.append('!!!!!!!! Caught KeyboardInterrupt')
+ except Exception as e:
+ cb.append('!!!!!!!! Caught exception: ' + repr(e))
+ else:
+ cb.append('No exception')
+EOF
+:debuggreedy
+:call inputsave()
+:call feedkeys("s\ns\ns\ns\nq\n")
+:redir => output
+:debug silent! py3 test_keyboard_interrupt()
+:redir END
+:0 debuggreedy
+:silent $put =output
+:unlet output
+:py3 del test_keyboard_interrupt
+:"
:" Cleanup
py3 << EOF
del cb
diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok
index eed179c5a9..970818c997 100644
--- a/src/testdir/test87.ok
+++ b/src/testdir/test87.ok
@@ -1187,3 +1187,7 @@ vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))
vim.eval("Exe('echoerr ''jkl''')"):(<class 'vim.error'>, error('Vim(echoerr):jkl',))
vim.eval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
+Caught KeyboardInterrupt
+Running :put
+No exception
+