Mercurial > vim
annotate src/testdir/test_changedtick.vim @ 16507:7c6fe15778cf v8.1.1257
patch 8.1.1257: MSVC: name of object directory now always right
commit https://github.com/vim/vim/commit/819d3e52a1eab35409ea7e0ebdb2340507a42684
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 3 22:15:03 2019 +0200
patch 8.1.1257: MSVC: name of object directory now always right
Problem: MSVC: name of object directory now always right.
Solution: Adjust comment. Don't use different directory for DIRECTX. Do
use different directory for USE_MSVCRT. (Ken Takata, closes #4333)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 03 May 2019 22:30:05 +0200 |
parents | fd1760f8c215 |
children | 1f418d27e11f |
rev | line source |
---|---|
10889
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for b:changedtick |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_changedtick_increments() |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 new |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 " New buffer has an empty line, tick starts at 2. |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 let expected = 2 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call assert_equal(expected, b:changedtick) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal(expected, b:['changedtick']) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call setline(1, 'hello') |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 let expected += 1 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call assert_equal(expected, b:changedtick) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_equal(expected, b:['changedtick']) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 undo |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 " Somehow undo counts as two changes. |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 let expected += 2 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call assert_equal(expected, b:changedtick) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal(expected, b:['changedtick']) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 bwipe! |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 endfunc |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 func Test_changedtick_dict_entry() |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 let d = b: |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 call assert_equal(b:changedtick, d['changedtick']) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 endfunc |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 func Test_changedtick_bdel() |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 new |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 let bnr = bufnr('%') |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 let v = b:changedtick |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 bdel |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 " Delete counts as a change too. |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal(v + 1, getbufvar(bnr, 'changedtick')) |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 endfunc |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
10912
fd1760f8c215
patch 8.0.0345: islocked('d.changedtick') does not work
Christian Brabandt <cb@256bit.org>
parents:
10908
diff
changeset
|
35 func Test_changedtick_islocked() |
fd1760f8c215
patch 8.0.0345: islocked('d.changedtick') does not work
Christian Brabandt <cb@256bit.org>
parents:
10908
diff
changeset
|
36 call assert_equal(0, islocked('b:changedtick')) |
fd1760f8c215
patch 8.0.0345: islocked('d.changedtick') does not work
Christian Brabandt <cb@256bit.org>
parents:
10908
diff
changeset
|
37 let d = b: |
fd1760f8c215
patch 8.0.0345: islocked('d.changedtick') does not work
Christian Brabandt <cb@256bit.org>
parents:
10908
diff
changeset
|
38 call assert_equal(0, islocked('d.changedtick')) |
fd1760f8c215
patch 8.0.0345: islocked('d.changedtick') does not work
Christian Brabandt <cb@256bit.org>
parents:
10908
diff
changeset
|
39 endfunc |
fd1760f8c215
patch 8.0.0345: islocked('d.changedtick') does not work
Christian Brabandt <cb@256bit.org>
parents:
10908
diff
changeset
|
40 |
10889
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 func Test_changedtick_fixed() |
10908
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
42 call assert_fails('let b:changedtick = 4', 'E46:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
43 call assert_fails('let b:["changedtick"] = 4', 'E46:') |
10889
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 |
10908
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
45 call assert_fails('lockvar b:changedtick', 'E940:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
46 call assert_fails('lockvar b:["changedtick"]', 'E46:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
47 call assert_fails('unlockvar b:changedtick', 'E940:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
48 call assert_fails('unlockvar b:["changedtick"]', 'E46:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
49 call assert_fails('unlet b:changedtick', 'E795:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
50 call assert_fails('unlet b:["changedtick"]', 'E46:') |
10889
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 let d = b: |
10908
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
53 call assert_fails('lockvar d["changedtick"]', 'E46:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
54 call assert_fails('unlockvar d["changedtick"]', 'E46:') |
6b6abffbdf59
patch 8.0.0343: b:changedtick can be unlocked
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
55 call assert_fails('unlet d["changedtick"]', 'E46:') |
10889
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 |
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 endfunc |