comparison src/testdir/test_usercommands.vim @ 26327:227543e4181f v8.2.3694

patch 8.2.3694: cannot use quotes in the count of an Ex command Commit: https://github.com/vim/vim/commit/af377e34b01ba00f9520d2b9de1f911e72db0114 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 29 12:12:43 2021 +0000 patch 8.2.3694: cannot use quotes in the count of an Ex command Problem: Cannot use quotes in the count of an Ex command. Solution: Add getdigits_quoted(). Give an error when misplacing a quote in a range. (closes #9240)
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Nov 2021 13:15:02 +0100
parents 012faa52874b
children e36aefc588c2
comparison
equal deleted inserted replaced
26326:2a3b022339b0 26327:227543e4181f
675 call assert_fails('delcommand -buffer Global', 'E1237:') 675 call assert_fails('delcommand -buffer Global', 'E1237:')
676 delcommand Global 676 delcommand Global
677 call assert_equal(0, exists(':Global')) 677 call assert_equal(0, exists(':Global'))
678 endfunc 678 endfunc
679 679
680 def Test_count_with_quotes()
681 command -count GetCount g:nr = <count>
682 execute("GetCount 1'2")
683 assert_equal(12, g:nr)
684 execute("GetCount 1'234'567")
685 assert_equal(1'234'567, g:nr)
686
687 execute("GetCount 1'234'567'890'123'456'789'012")
688 assert_equal(v:sizeoflong == 8 ? 9223372036854775807 : 2147483647, g:nr)
689
690 # TODO: test with negative number once this is supported
691
692 assert_fails("GetCount '12", "E488:")
693 assert_fails("GetCount 12'", "E488:")
694 assert_fails("GetCount 1''2", "E488:")
695
696 assert_fails(":1'2GetCount", 'E492:')
697 new
698 setline(1, 'text')
699 normal ma
700 execute(":1, 'aprint")
701 bwipe!
702
703 unlet g:nr
704 delcommand GetCount
705 enddef
706
707
680 " vim: shiftwidth=2 sts=2 expandtab 708 " vim: shiftwidth=2 sts=2 expandtab