diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-04-09 14:14:55 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-04-09 14:14:55 -0400 |
commit | bf2c2b34cf2314a03236c692b02778eb964dcccb (patch) | |
tree | 266904cc79d9764e707b3dc62c9dd1b3f909baae /test/functional/legacy/eval_spec.lua | |
parent | d227c843bf11f4dca8c9eb3a23f529b2977fcd21 (diff) | |
parent | de7165d3511225cf2323d81acd3724ee0379acad (diff) | |
download | rneovim-bf2c2b34cf2314a03236c692b02778eb964dcccb.tar.gz rneovim-bf2c2b34cf2314a03236c692b02778eb964dcccb.tar.bz2 rneovim-bf2c2b34cf2314a03236c692b02778eb964dcccb.zip |
Merge pull request #4357 from jbradaric/vim-7.4.1105
vim-patch:7.4.1105
Diffstat (limited to 'test/functional/legacy/eval_spec.lua')
-rw-r--r-- | test/functional/legacy/eval_spec.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/legacy/eval_spec.lua b/test/functional/legacy/eval_spec.lua index e0a4e10746..d1ed96cc2e 100644 --- a/test/functional/legacy/eval_spec.lua +++ b/test/functional/legacy/eval_spec.lua @@ -693,4 +693,22 @@ describe('eval', function() start: 6]]) end) + + it('substring and variable name', function() + execute("let str = 'abcdef'") + execute('let n = 3') + eq('def', eval('str[n:]')) + eq('abcd', eval('str[:n]')) + eq('d', eval('str[n:n]')) + execute('unlet n') + execute('let nn = 3') + eq('def', eval('str[nn:]')) + eq('abcd', eval('str[:nn]')) + eq('d', eval('str[nn:nn]')) + execute('unlet nn') + execute('let b:nn = 4') + eq('ef', eval('str[b:nn:]')) + eq('abcde', eval('str[:b:nn]')) + eq('e', eval('str[b:nn:b:nn]')) + end) end) |