diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-09 02:29:18 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-09 03:24:20 +0300 |
commit | bd84bf8c818f7673eabad0d9863b98a069cb0d75 (patch) | |
tree | 13dfc8b509ddeca2d2479f678955b1038136d230 /test/functional/legacy/eval_spec.lua | |
parent | e170186a8df448cab30dba7af6a6b2d081bfd62e (diff) | |
download | rneovim-bd84bf8c818f7673eabad0d9863b98a069cb0d75.tar.gz rneovim-bd84bf8c818f7673eabad0d9863b98a069cb0d75.tar.bz2 rneovim-bd84bf8c818f7673eabad0d9863b98a069cb0d75.zip |
functests: Fix legacy/eval_spec
Diffstat (limited to 'test/functional/legacy/eval_spec.lua')
-rw-r--r-- | test/functional/legacy/eval_spec.lua | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/test/functional/legacy/eval_spec.lua b/test/functional/legacy/eval_spec.lua index 936c2562f3..d7ef508194 100644 --- a/test/functional/legacy/eval_spec.lua +++ b/test/functional/legacy/eval_spec.lua @@ -6,6 +6,7 @@ local clear, command, expect = helpers.clear, helpers.command, helpers.expect local eq, eval, write_file = helpers.eq, helpers.eval, helpers.write_file local wait = helpers.wait local exc_exec = helpers.exc_exec +local dedent = helpers.dedent describe('eval', function() setup(function() @@ -617,42 +618,32 @@ describe('eval', function() end) it('function name not starting with a capital', function() - command('try') - command(' func! g:test()') - command(' echo "test"') - command(' endfunc') - command('catch') - command(' let tmp = v:exception') - command('endtry') - eq('Vim(function):E128: Function name must start with a capital or "s:": g:test()', eval('tmp')) + eq('Vim(function):E128: Function name must start with a capital or "s:": g:test()\\nendfunction', + exc_exec(dedent([[ + function! g:test() + endfunction]]))) end) it('Function name followed by #', function() - command('try') - command(' func! test2() "#') - command(' echo "test2"') - command(' endfunc') - command('catch') - command(' let tmp = v:exception') - command('endtry') - eq('Vim(function):E128: Function name must start with a capital or "s:": test2() "#', eval('tmp')) + eq('Vim(function):E128: Function name must start with a capital or "s:": test2() "#\\nendfunction', + exc_exec(dedent([[ + function! test2() "# + endfunction]]))) end) it('function name includes a colon', function() - command('try') - command(' func! b:test()') - command(' echo "test"') - command(' endfunc') - command('catch') - command(' let tmp = v:exception') - command('endtry') - eq('Vim(function):E128: Function name must start with a capital or "s:": b:test()', eval('tmp')) + eq('Vim(function):E128: Function name must start with a capital or "s:": b:test()\\nendfunction', + exc_exec(dedent([[ + function! b:test() + endfunction]]))) end) it('function name starting with/without "g:", buffer-local funcref', function() - command('function! g:Foo(n)') - command(" $put ='called Foo(' . a:n . ')'") - command('endfunction') + command([[ + function! g:Foo(n) + $put ='called Foo(' . a:n . ')' + endfunction + ]]) command("let b:my_func = function('Foo')") command('call b:my_func(1)') command('echo g:Foo(2)') |