aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/source_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-25 15:07:25 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-25 15:50:34 +0800
commitba360a26a294e0ed83ff8e401caabaf4a17c7c30 (patch)
treeed9b268528cbf11ca4445a4e659e94f639f4c9a6 /test/functional/legacy/source_spec.lua
parent2738f842f6da712ec0648620d846bfacb14bdcef (diff)
downloadrneovim-ba360a26a294e0ed83ff8e401caabaf4a17c7c30.tar.gz
rneovim-ba360a26a294e0ed83ff8e401caabaf4a17c7c30.tar.bz2
rneovim-ba360a26a294e0ed83ff8e401caabaf4a17c7c30.zip
vim-patch:8.2.2684: not enough folding code is tested
Problem: Not enough folding code is tested. Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#8046) https://github.com/vim/vim/commit/5c504f680e63120fea36becfabb8d939d4449e34 Reorder test_fold.vim to match upstream. Cherry-pick Test_fold_expr_error() from patch 8.2.0633. Cherry-pick syntax feature check from patch 8.2.1432. Cherry-pick a delete() call from patch 8.2.2112.
Diffstat (limited to 'test/functional/legacy/source_spec.lua')
-rw-r--r--test/functional/legacy/source_spec.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/legacy/source_spec.lua b/test/functional/legacy/source_spec.lua
new file mode 100644
index 0000000000..02e6385247
--- /dev/null
+++ b/test/functional/legacy/source_spec.lua
@@ -0,0 +1,31 @@
+local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
+local clear = helpers.clear
+local feed = helpers.feed
+local write_file = helpers.write_file
+
+before_each(clear)
+
+describe(':source!', function()
+ it('gives E22 when scripts nested too deep', function()
+ write_file('Xscript.vim', [[
+ :source! Xscript.vim
+ ]])
+ local screen = Screen.new(75, 6)
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
+ [1] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg
+ })
+ screen:attach()
+ feed(':source! Xscript.vim\n')
+ screen:expect([[
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1:E22: Scripts nested too deep} |
+ ]])
+ os.remove('Xscript.vim')
+ end)
+end)