]> granicus.if.org Git - vim/commitdiff
patch 8.1.2043: not sufficient testing for quoted numbers v8.1.2043
authorBram Moolenaar <Bram@vim.org>
Sun, 15 Sep 2019 19:12:22 +0000 (21:12 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 15 Sep 2019 19:12:22 +0000 (21:12 +0200)
Problem:    Not sufficient testing for quoted numbers.
Solution:   Add a few more test cases.

src/testdir/test_eval_stuff.vim
src/testdir/test_functions.vim
src/version.c

index 4e8b782f124c28b09b5762e75825dabef528e1bc..ec566da04a3eae871ba32c4f9679952c8eb6d2c9 100644 (file)
@@ -200,6 +200,9 @@ func Test_vvar_scriptversion4()
   call assert_equal(64, 0b1'00'00'00)
   call assert_equal(1048576, 0x10'00'00)
   call assert_equal(1000000, 1'000'000)
+  call assert_equal("1234", execute("echo 1'234")->trim())
+  call assert_equal('1  234', execute("echo 1''234")->trim())
+  call assert_fails("echo 1'''234", 'E115:')
 endfunc
 
 scriptversion 1
index e782061886520119696c80748a705d6cd1fe46b1..37aba38f9c8efa3d90df4f0de57b390c9a0d7e82 100644 (file)
@@ -161,6 +161,7 @@ func Test_str2nr()
   call assert_equal(256, str2nr("1'0000'0000", 2, 1))
   call assert_equal(262144, str2nr("1'000'000", 8, 1))
   call assert_equal(1000000, str2nr("1'000'000", 10, 1))
+  call assert_equal(1000, str2nr("1'000''000", 10, 1))
   call assert_equal(65536, str2nr("1'00'00", 16, 1))
 
   call assert_equal(0, str2nr('0x10'))
index e9a71a88cb0bb3453bba85729895e7b09576df66..919d8fdf3f87d6706f329fbed057c80a9baa43eb 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2043,
 /**/
     2042,
 /**/