diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-01 12:17:00 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-01 12:17:00 +0000 |
commit | b79ee0c299d786627784f7304ba84b80e78ece26 (patch) | |
tree | 8c7d0b09c3592f3bb221fabf4d0ff5ae86abf216 /src/testdir/test_vim9_script.vim | |
parent | 654b729c4c9951f2a46c161d1e9fefdc223fc94e (diff) |
patch 8.2.3965: Vim9: no easy way to check if Vim9 script is supportedv8.2.3965
Problem: Vim9: no easy way to check if Vim9 script is supported.
Solution: Add has('vim9script').
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index f79112ea9b..8aea267591 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -7,6 +7,23 @@ source vim9.vim source shared.vim source screendump.vim +def Test_vim9script_feature() + # example from the help, here the feature is always present + var lines =<< trim END + " old style comment + if !has('vim9script') + " legacy commands would go here + finish + endif + vim9script + # Vim9 script commands go here + g:didit = true + END + CheckScriptSuccess(lines) + assert_equal(true, g:didit) + unlet g:didit +enddef + def Test_range_only() new setline(1, ['blah', 'Blah']) |