diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-10-02 09:49:11 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-10-02 09:49:11 -0400 |
commit | 60e5d8d1ccd5a07038138f18752620edebeb8a3d (patch) | |
tree | 1633766a082252e2b1074968377d1fd98481e496 /scripts/run-functional-tests.py | |
parent | 1f622d63bcd3018e5e714c02e6d0b58431c658e4 (diff) | |
parent | 45525853d3521e73512f68bb390aae0e385ef66c (diff) | |
download | rneovim-60e5d8d1ccd5a07038138f18752620edebeb8a3d.tar.gz rneovim-60e5d8d1ccd5a07038138f18752620edebeb8a3d.tar.bz2 rneovim-60e5d8d1ccd5a07038138f18752620edebeb8a3d.zip |
Merge pull request #1260 from tarruda/system-specs
Fix coverity defect(Resource leak) and add some specs which expose the bug to valgrind
Diffstat (limited to 'scripts/run-functional-tests.py')
-rw-r--r-- | scripts/run-functional-tests.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/run-functional-tests.py b/scripts/run-functional-tests.py index 1b8fb2ddef..3e931b248c 100644 --- a/scripts/run-functional-tests.py +++ b/scripts/run-functional-tests.py @@ -4,7 +4,7 @@ import os import sys import textwrap -from lupa import LuaRuntime +from lupa import LuaRuntime, as_attrgetter from neovim import Nvim, spawn_session @@ -33,6 +33,14 @@ function(d) end ''') +def to_table(obj): + if type(obj) in [tuple, list]: + return list_to_table(list(to_table(e) for e in obj)) + if type(obj) is dict: + return dict_to_table(as_attrgetter( + dict((k, to_table(v)) for k, v in obj.items()))) + return obj + nvim_prog = os.environ.get('NVIM_PROG', 'build/bin/nvim') nvim_argv = [nvim_prog, '-u', 'NONE', '--embed'] @@ -51,6 +59,9 @@ nvim = Nvim.from_session(session) def nvim_command(cmd): nvim.command(cmd) +def nvim_eval(expr): + return to_table(nvim.eval(expr)) + def nvim_feed(input, mode=''): nvim.feedkeys(input) @@ -63,6 +74,7 @@ def nvim_replace_termcodes(input, *opts): expose = [ nvim_command, + nvim_eval, nvim_feed, nvim_replace_termcodes, buffer_slice, |