diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-03-04 20:47:39 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-03-04 20:47:39 +0000 |
commit | 5fb78c3fa5c996c08a65431d698bd2c251eef5c7 (patch) | |
tree | 859712525dc94a60f02b27c38d23fdf7f3e96590 /src/testdir | |
parent | 5284b23e148063648be0ff46c730ca574e3ca9fa (diff) |
patch 9.0.1380: CTRL-X on 2**64 subtracts twov9.0.1380
Problem: CTRL-X on 2**64 subtracts two. (James McCoy)
Solution: Correct computation for large number. (closes #12103)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_increment.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_increment.vim b/src/testdir/test_increment.vim index c367f2bab5..fdd7c0ce01 100644 --- a/src/testdir/test_increment.vim +++ b/src/testdir/test_increment.vim @@ -840,6 +840,22 @@ func Test_increment_unsigned() set nrformats-=unsigned endfunc +func Test_in_decrement_large_number() + " NOTE: 18446744073709551616 == 2^64 + call setline(1, '18446744073709551616') + exec "norm! gg0\<C-X>" + call assert_equal('18446744073709551615', getline(1)) + + exec "norm! gg0\<C-X>" + call assert_equal('18446744073709551614', getline(1)) + + exec "norm! gg0\<C-A>" + call assert_equal('18446744073709551615', getline(1)) + + exec "norm! gg0\<C-A>" + call assert_equal('-18446744073709551615', getline(1)) +endfunc + func Test_normal_increment_with_virtualedit() set virtualedit=all |