summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_let.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_let.vim')
-rw-r--r--src/testdir/test_let.vim52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/testdir/test_let.vim b/src/testdir/test_let.vim
index c99207c127..1d616350ba 100644
--- a/src/testdir/test_let.vim
+++ b/src/testdir/test_let.vim
@@ -396,6 +396,42 @@ func Test_let_heredoc_fails()
call assert_report('Caught exception: ' .. v:exception)
endtry
+ try
+ let @- =<< trim TEXT
+ change
+ insert
+ append
+ TEXT
+ call assert_report('No exception thrown')
+ catch /E730:/
+ catch
+ call assert_report('Caught exception: ' .. v:exception)
+ endtry
+
+ try
+ let [a b c] =<< trim TEXT
+ change
+ insert
+ append
+ TEXT
+ call assert_report('No exception thrown')
+ catch /E475:/
+ catch
+ call assert_report('Caught exception: ' .. v:exception)
+ endtry
+
+ try
+ let [a; b; c] =<< trim TEXT
+ change
+ insert
+ append
+ TEXT
+ call assert_report('No exception thrown')
+ catch /E452:/
+ catch
+ call assert_report('Caught exception: ' .. v:exception)
+ endtry
+
let text =<< trim END
func WrongSyntax()
let v =<< that there
@@ -571,6 +607,22 @@ append
END
call assert_equal(['change', 'insert', 'append'], [a, b, c])
+ " unpack assignment with semicolon
+ let [a; b] =<< END
+change
+insert
+append
+END
+ call assert_equal(['change', ['insert', 'append']], [a, b])
+
+ " unpack assignment with registers
+ let [@/, @", @-] =<< END
+change
+insert
+append
+END
+ call assert_equal(['change', 'insert', 'append'], [@/, @", @-])
+
" curly braces name and list slice assignment
let foo_3_bar = ['', '', '']
let foo_{1 + 2}_bar[ : ] =<< END