diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-11-04 18:02:44 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-11-04 18:02:44 +0100 |
commit | f65b35b4465d3622128bd82bd3775f833542eb1f (patch) | |
tree | c11ea8b67a681f82d3b68334f6a079ab3f3fa741 /src/testdir/test_vim9_cmd.vim | |
parent | 631e8f93458b102091d54c502f489c03e454d4da (diff) |
patch 8.2.1954: Vim9: not all command modifiers are testedv8.2.1954
Problem: Vim9: not all command modifiers are tested.
Solution: Add tests for "keep" modifiers. Fix that marks are lost even
though ":lockmarks" is used.
Diffstat (limited to 'src/testdir/test_vim9_cmd.vim')
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 2ba779b766..71c47cdcef 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -439,13 +439,42 @@ def Test_command_modifiers_keep() DoTest(false, true, true) DoTest(true, true, true) set cpo&vim + + new + setline(1, ['one', 'two', 'three', 'four']) + assert_equal(4, line("$")) + normal 1Gma + normal 2Gmb + normal 3Gmc + lockmarks :1,2!wc + # line is deleted, marks don't move + assert_equal(3, line("$")) + assert_equal('four', getline(3)) + assert_equal(1, line("'a")) + assert_equal(2, line("'b")) + assert_equal(3, line("'c")) + quit! endif - # TODO - # lockmarks - # keepalt - # keeppatterns - # keepjumps + edit Xone + edit Xtwo + assert_equal('Xone', expand('#')) + keepalt edit Xthree + assert_equal('Xone', expand('#')) + + normal /a*b* + assert_equal('a*b*', histget("search")) + keeppatterns normal /c*d* + assert_equal('a*b*', histget("search")) + + new + setline(1, range(10)) + :10 + normal gg + assert_equal(10, getpos("''")[1]) + keepjumps normal 5G + assert_equal(10, getpos("''")[1]) + quit! enddef def Test_command_modifier_other() |