diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-29 20:00:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-29 20:00:38 +0200 |
commit | 1040956292a9f2c3d02fc08febd5acf349c85590 (patch) | |
tree | 9478dbc3a208ce7689737cd8ba36aac07c86689e /src/testdir | |
parent | 7b7f78f51dc5a2c307330af0d4e53faced34726f (diff) |
patch 8.2.1322: Vim9: method on double quoted string doesn't workv8.2.1322
Problem: Vim9: method on double quoted string doesn't work.
Solution: Recognize double quoted string. (closes #6562)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 5 | ||||
-rw-r--r-- | src/testdir/test_vim9_func.vim | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index 5b46c32f96..e29ef5cf0e 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1638,8 +1638,9 @@ enddef def Test_expr7_method_call() new setline(1, ['first', 'last']) - eval 'second'->append(1) - assert_equal(['first', 'second', 'last'], getline(1, '$')) + 'second'->append(1) + "third"->append(2) + assert_equal(['first', 'second', 'third', 'last'], getline(1, '$')) bwipe! let bufnr = bufnr() diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index c05e98e704..2546f1369f 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -502,8 +502,11 @@ def Test_vim9script_call() assert_equal('some', var) # line starting with single quote is not a mark + # line starting with double quote can be a method call 'asdfasdf'->MyFunc() assert_equal('asdfasdf', var) + "xyz"->MyFunc() + assert_equal('xyz', var) def UseString() 'xyork'->MyFunc() @@ -511,6 +514,12 @@ def Test_vim9script_call() UseString() assert_equal('xyork', var) + def UseString2() + "knife"->MyFunc() + enddef + UseString2() + assert_equal('knife', var) + # prepending a colon makes it a mark new setline(1, ['aaa', 'bbb', 'ccc']) |