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)
diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim
index 6707a03..d560f49 100644
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -677,4 +677,32 @@
call assert_equal(0, exists(':Global'))
endfunc
+def Test_count_with_quotes()
+ command -count GetCount g:nr = <count>
+ execute("GetCount 1'2")
+ assert_equal(12, g:nr)
+ execute("GetCount 1'234'567")
+ assert_equal(1'234'567, g:nr)
+
+ execute("GetCount 1'234'567'890'123'456'789'012")
+ assert_equal(v:sizeoflong == 8 ? 9223372036854775807 : 2147483647, g:nr)
+
+ # TODO: test with negative number once this is supported
+
+ assert_fails("GetCount '12", "E488:")
+ assert_fails("GetCount 12'", "E488:")
+ assert_fails("GetCount 1''2", "E488:")
+
+ assert_fails(":1'2GetCount", 'E492:')
+ new
+ setline(1, 'text')
+ normal ma
+ execute(":1, 'aprint")
+ bwipe!
+
+ unlet g:nr
+ delcommand GetCount
+enddef
+
+
" vim: shiftwidth=2 sts=2 expandtab