aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_let.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-02 00:57:49 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 15:27:56 +0100
commitcbecae46f4b098cd6018055c7f4c70bd147c7938 (patch)
tree738da5fd30a7cbb66a7a6d456461ce3049bcf770 /src/nvim/testdir/test_let.vim
parent4fe4b5abb6845b51af195e77576179ff5281451e (diff)
downloadrneovim-cbecae46f4b098cd6018055c7f4c70bd147c7938.tar.gz
rneovim-cbecae46f4b098cd6018055c7f4c70bd147c7938.tar.bz2
rneovim-cbecae46f4b098cd6018055c7f4c70bd147c7938.zip
vim-patch:8.0.0861: still many old style tests
Problem: Still many old style tests. Solution: Convert several tests to new style. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/4a137b45864310060410f34cb9c7d0f0231bb256 vim-patch:8.0.0862: file size test fails on MS-Windows Problem: File size test fails on MS-Windows. Solution: Set fileformat after opening new buffer. Strip CR. https://github.com/vim/vim/commit/07c043af5f054c7dfeb676414f8fa6aeda8f9c2b
Diffstat (limited to 'src/nvim/testdir/test_let.vim')
-rw-r--r--src/nvim/testdir/test_let.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_let.vim b/src/nvim/testdir/test_let.vim
new file mode 100644
index 0000000000..24c6ef5e01
--- /dev/null
+++ b/src/nvim/testdir/test_let.vim
@@ -0,0 +1,27 @@
+" Tests for the :let command.
+
+func Test_let()
+ " Test to not autoload when assigning. It causes internal error.
+ set runtimepath+=./sautest
+ let Test104#numvar = function('tr')
+ call assert_equal("function('tr')", string(Test104#numvar))
+
+ let a = 1
+ let b = 2
+
+ let out = execute('let a b')
+ let s = "\na #1\nb #2"
+ call assert_equal(s, out)
+
+ let out = execute('let {0 == 1 ? "a" : "b"}')
+ let s = "\nb #2"
+ call assert_equal(s, out)
+
+ let out = execute('let {0 == 1 ? "a" : "b"} a')
+ let s = "\nb #2\na #1"
+ call assert_equal(s, out)
+
+ let out = execute('let a {0 == 1 ? "a" : "b"}')
+ let s = "\na #1\nb #2"
+ call assert_equal(s, out)
+endfunc