Skip to content

Commit

Permalink
patch 9.0.1122: class member access is not fully tested yet
Browse files Browse the repository at this point in the history
Problem:    Class member access is not fully tested yet.
Solution:   Add more tests.
  • Loading branch information
brammool committed Dec 31, 2022
1 parent f1dcd14 commit 9f2d97e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/testdir/test_vim9_class.vim
Expand Up @@ -374,6 +374,8 @@ def Test_class_member_access()
this.lnum = 1
this.col = 1
static counter = 0
static _secret = 7
public static anybody = 42

def AddToCounter(nr: number)
counter += nr
Expand All @@ -386,7 +388,17 @@ def Test_class_member_access()
assert_fails('echo TextPos.noSuchMember', 'E1338:')

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
v9.CheckScriptSuccess(lines)
enddef
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1122,
/**/
1121,
/**/
Expand Down

0 comments on commit 9f2d97e

Please sign in to comment.