summaryrefslogtreecommitdiff
path: root/src/testdir/test_vim9_cmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-21 19:59:08 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-21 19:59:08 +0100
commitf4e2099e39ed4d71aed0f9a9579455aed5ec6cc2 (patch)
tree40a384257e29f443c46bbaa19fb88a8eb5441b05 /src/testdir/test_vim9_cmd.vim
parenta3d10a508c404a32485adc86284725e0bdc5b602 (diff)
downloadvim-git-f4e2099e39ed4d71aed0f9a9579455aed5ec6cc2.tar.gz
patch 8.2.2182: Vim9: value of 'magic' is still relevantv8.2.2182
Problem: Vim9: value of 'magic' is still relevant. Solution: Always behave like 'magic' is on in Vim9 script (closes #7509)
Diffstat (limited to 'src/testdir/test_vim9_cmd.vim')
-rw-r--r--src/testdir/test_vim9_cmd.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index d297931bc..3b8a7a45e 100644
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -722,4 +722,22 @@ def Test_command_not_recognized()
CheckDefFailure(lines, 'E1146:', 1)
enddef
+def Test_magic_not_used()
+ new
+ for cmd in ['set magic', 'set nomagic']
+ exe cmd
+ setline(1, 'aaa')
+ s/.../bbb/
+ assert_equal('bbb', getline(1))
+ endfor
+
+ set magic
+ setline(1, 'aaa')
+ assert_fails('s/.\M../bbb/', 'E486:')
+ assert_fails('snomagic/.../bbb/', 'E486:')
+ assert_equal('aaa', getline(1))
+
+ bwipe!
+enddef
+
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker