diff src/testdir/test_python2.vim @ 34234:daaff6843090 v9.1.0062

patch 9.1.0062: Internal error when :luado/perldo/pydo etc delete lines Commit: https://github.com/vim/vim/commit/e99f0688785c3d56b1ee45a28fa6ce02b850a33b Author: zeertzjq <zeertzjq@outlook.com> Date: Mon Jan 29 19:32:39 2024 +0100 patch 9.1.0062: Internal error when :luado/perldo/pydo etc delete lines Problem: Internal error when :luado/perldo/pydo etc delete lines Solution: Test that the line is still valid line number (zeertzjq) closes: #13931 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 29 Jan 2024 19:45:06 +0100
parents 029c59bf78f1
children
line wrap: on
line diff
--- a/src/testdir/test_python2.vim
+++ b/src/testdir/test_python2.vim
@@ -56,10 +56,25 @@ func Test_AAA_python_setup()
 endfunc
 
 func Test_pydo()
+  new
+
   " Check deleting lines does not trigger an ml_get error.
-  new
   call setline(1, ['one', 'two', 'three'])
   pydo vim.command("%d_")
+  call assert_equal([''], getline(1, '$'))
+
+  call setline(1, ['one', 'two', 'three'])
+  pydo vim.command("1,2d_")
+  call assert_equal(['three'], getline(1, '$'))
+
+  call setline(1, ['one', 'two', 'three'])
+  pydo vim.command("2,3d_"); return "REPLACED"
+  call assert_equal(['REPLACED'], getline(1, '$'))
+
+  call setline(1, ['one', 'two', 'three'])
+  2,3pydo vim.command("1,2d_"); return "REPLACED"
+  call assert_equal(['three'], getline(1, '$'))
+
   bwipe!
 
   " Check switching to another buffer does not trigger an ml_get error.