diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-02-24 20:09:14 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-02-27 23:29:07 +0100 |
commit | 89515304e4eb81ff9eb65f3a582136fc658de139 (patch) | |
tree | 24b445c4aa5588772aa98f830f4646a738727810 /test/unit/helpers.lua | |
parent | 1d8e7683604828592bd41cdac5a351145cd93487 (diff) | |
download | rneovim-89515304e4eb81ff9eb65f3a582136fc658de139.tar.gz rneovim-89515304e4eb81ff9eb65f3a582136fc658de139.tar.bz2 rneovim-89515304e4eb81ff9eb65f3a582136fc658de139.zip |
os/env: use libuv v1.12 getenv/setenv API
- Minimum required libuv is now v1.12
- Because `uv_os_getenv` requires allocating, we must manage a map
(`envmap` in `env.c`) to maintain the old behavior of `os_getenv` .
- free() map-items after removal. khash.h does not make copies of
anything, so even its keys must be memory-managed by the caller.
closes #8398
closes #9267
Diffstat (limited to 'test/unit/helpers.lua')
-rw-r--r-- | test/unit/helpers.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua index f8143a0125..beb25f25db 100644 --- a/test/unit/helpers.lua +++ b/test/unit/helpers.lua @@ -645,16 +645,16 @@ local function itp_child(wr, func) s = s:sub(1, hook_msglen - 2) sc.write(wr, '>' .. s .. (' '):rep(hook_msglen - 2 - #s) .. '\n') end - local err, emsg = pcall(init) - if err then + local status, result = pcall(init) + if status then collectgarbage('stop') child_sethook(wr) - err, emsg = pcall(func) + status, result = pcall(func) debug.sethook() end - emsg = tostring(emsg) sc.write(wr, trace_end_msg) - if not err then + if not status then + local emsg = tostring(result) if #emsg > 99999 then emsg = emsg:sub(1, 99999) end @@ -668,7 +668,7 @@ local function itp_child(wr, func) collectgarbage() sc.write(wr, '$\n') sc.close(wr) - sc.exit(err and 0 or 1) + sc.exit(status and 0 or 1) end local function check_child_err(rd) |