diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-03-29 10:08:23 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-03-29 10:08:23 +0100 |
commit | abedca96efa76db2bba74a5264df632da862203d (patch) | |
tree | 1f9a4e131bd8837945296f5d5f3eaee56cb3157d /src/testdir | |
parent | 059aeac2be1a0d30ff80751215794457c1ef1589 (diff) |
patch 9.1.0226: Not able to assign enum values to an enum static variablev9.1.0226
Problem: Not able to assign enum values to an enum static variable
(zzzyxwvut)
Solution: Make it work
(Yegappan Lakshmanan)
related: #14224
closes: #14329
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_enum.vim | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_enum.vim b/src/testdir/test_vim9_enum.vim index 6e10e0c705..ceea32fe4f 100644 --- a/src/testdir/test_vim9_enum.vim +++ b/src/testdir/test_vim9_enum.vim @@ -964,7 +964,7 @@ def Test_enum_refcount() enum Star Gemini, - Orion, + Orion endenum assert_equal(3, test_refcount(Star)) assert_equal(2, test_refcount(Star.Gemini)) @@ -1473,4 +1473,17 @@ def Test_enum_eval() v9.CheckSourceSuccess(lines) enddef +" Test for using "values" in an enum class variable +def Test_use_enum_values_in_class_variable() + var lines =<< trim END + vim9script + enum Dir + North, South + static const dirs: list<Dir> = Dir.values + endenum + assert_equal([Dir.North, Dir.South], Dir.dirs) + END + v9.CheckSourceSuccess(lines) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |