0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 9.0.1122: class member access is not fully tested yet

Problem:    Class member access is not fully tested yet.
Solution:   Add more tests.
This commit is contained in:
Bram Moolenaar
2022-12-31 19:01:02 +00:00
parent f1dcd14fc5
commit 9f2d97efe2
2 changed files with 15 additions and 1 deletions

View File

@@ -374,6 +374,8 @@ def Test_class_member_access()
this.lnum = 1 this.lnum = 1
this.col = 1 this.col = 1
static counter = 0 static counter = 0
static _secret = 7
public static anybody = 42
def AddToCounter(nr: number) def AddToCounter(nr: number)
counter += nr counter += nr
@@ -386,7 +388,17 @@ def Test_class_member_access()
assert_fails('echo TextPos.noSuchMember', 'E1338:') assert_fails('echo TextPos.noSuchMember', 'E1338:')
assert_fails('TextPos.noSuchMember = 2', 'E1337:') assert_fails('TextPos.noSuchMember = 2', 'E1337:')
assert_fails('TextPos.counter += 5', 'E1335') assert_fails('TextPos.counter = 5', 'E1335:')
assert_fails('TextPos.counter += 5', 'E1335:')
assert_fails('echo TextPos._secret', 'E1333:')
assert_fails('TextPos._secret = 8', 'E1333:')
assert_equal(42, TextPos.anybody)
TextPos.anybody = 12
assert_equal(12, TextPos.anybody)
TextPos.anybody += 5
assert_equal(17, TextPos.anybody)
END END
v9.CheckScriptSuccess(lines) v9.CheckScriptSuccess(lines)
enddef enddef

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1122,
/**/ /**/
1121, 1121,
/**/ /**/