diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-08 20:48:36 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-08 20:48:36 +0200 |
commit | 260addf7955f3695d3daef9dcf840952af9fd851 (patch) | |
tree | 1288c7c7286a0eb9615faaa375d81cfd2e96cc4a | |
parent | 21f8d93c7184e69aa76a5caa1d3869b6226189e0 (diff) | |
download | vim-git-260addf7955f3695d3daef9dcf840952af9fd851.tar.gz |
patch 8.1.1501: new behavior of b:changedtick not testedv8.1.1501
Problem: New behavior of b:changedtick not tested.
Solution: Add a few test cases. (Daniel Hahler)
-rw-r--r-- | src/testdir/test_changedtick.vim | 38 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/testdir/test_changedtick.vim b/src/testdir/test_changedtick.vim index 3a91bb54a..c789cdc1b 100644 --- a/src/testdir/test_changedtick.vim +++ b/src/testdir/test_changedtick.vim @@ -55,3 +55,41 @@ func Test_changedtick_fixed() call assert_fails('unlet d["changedtick"]', 'E46:') endfunc + +func Test_changedtick_not_incremented_with_write() + new + let fname = "XChangeTick" + exe 'w ' .. fname + + " :write when the buffer is not changed does not increment changedtick + let expected = b:changedtick + w + call assert_equal(expected, b:changedtick) + + " :write when the buffer IS changed DOES increment changedtick + let expected = b:changedtick + 1 + setlocal modified + w + call assert_equal(expected, b:changedtick) + + " Two ticks: change + write + let expected = b:changedtick + 2 + call setline(1, 'hello') + w + call assert_equal(expected, b:changedtick) + + " Two ticks: start insert + write + let expected = b:changedtick + 2 + normal! o + w + call assert_equal(expected, b:changedtick) + + " Three ticks: start insert + change + write + let expected = b:changedtick + 3 + normal! ochanged + w + call assert_equal(expected, b:changedtick) + + bwipe + call delete(fname) +endfunc diff --git a/src/version.c b/src/version.c index b0dcd3b11..3dcf0c631 100644 --- a/src/version.c +++ b/src/version.c @@ -768,6 +768,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1501, +/**/ 1500, /**/ 1499, |