aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-02-17 02:08:21 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-02-17 02:08:21 +0100
commit706b01ba7999b65da68055a7ac75c2be410ffd2c (patch)
tree10d60b3bb28151dde32730f34e7dfdd0074e2cbd /test
parent4a107a11a1c708c2fb8e40b6464f080aca111767 (diff)
parent095e6cc2e098db110981e5f9ea4bbc0ce316cecb (diff)
downloadrneovim-706b01ba7999b65da68055a7ac75c2be410ffd2c.tar.gz
rneovim-706b01ba7999b65da68055a7ac75c2be410ffd2c.tar.bz2
rneovim-706b01ba7999b65da68055a7ac75c2be410ffd2c.zip
Merge #6114 'Partial string handling refactoring'.
Diffstat (limited to 'test')
-rw-r--r--test/functional/eval/let_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/eval/let_spec.lua b/test/functional/eval/let_spec.lua
new file mode 100644
index 0000000000..c3ab3cc367
--- /dev/null
+++ b/test/functional/eval/let_spec.lua
@@ -0,0 +1,22 @@
+local helpers = require('test.functional.helpers')(after_each)
+
+local eq = helpers.eq
+local clear = helpers.clear
+local meths = helpers.meths
+local redir_exec = helpers.redir_exec
+
+before_each(clear)
+
+describe(':let command', function()
+ it('correctly lists variables with curly-braces', function()
+ meths.set_var('v', {0})
+ eq('\nv [0]', redir_exec('let {"v"}'))
+ end)
+
+ it('correctly lists variables with subscript', function()
+ meths.set_var('v', {0})
+ eq('\nv[0] #0', redir_exec('let v[0]'))
+ eq('\ng:["v"][0] #0', redir_exec('let g:["v"][0]'))
+ eq('\n{"g:"}["v"][0] #0', redir_exec('let {"g:"}["v"][0]'))
+ end)
+end)