aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-07-02 12:51:06 -0400
committerJames McCoy <jamessan@jamessan.com>2017-07-02 12:52:43 -0400
commit4d017256996fe7c7e19944f78c67d9fcb156ada7 (patch)
tree6c257d08db6ccf66279bb8e1a9516afad74a867a
parentca4633bfe4d0f58bd5fb7343d282fafb71f3a3ee (diff)
downloadrneovim-4d017256996fe7c7e19944f78c67d9fcb156ada7.tar.gz
rneovim-4d017256996fe7c7e19944f78c67d9fcb156ada7.tar.bz2
rneovim-4d017256996fe7c7e19944f78c67d9fcb156ada7.zip
test: expand_env_esc: Pass correct buffer size for outlen and assertion
Running this test with a mocked passwd file whose $HOME was set to /home/jamessan/src/debian.org/pkg-vim/deb-packages/neovim/neovim-0.2.0/debian/fakehome caused the test to fail, since the expanded result was >= 99 bytes. The test should be reflecting the actual size of the buffer, instead of some arbitrary other number, anwyay.
-rw-r--r--test/unit/os/env_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua
index cefd0315b7..c54d5a9b77 100644
--- a/test/unit/os/env_spec.lua
+++ b/test/unit/os/env_spec.lua
@@ -229,10 +229,10 @@ describe('env.c', function()
local src = to_cstr("~"..curuser.."/Vcs/django-rest-framework/rest_framework/renderers.py")
local dst = cstr(256, "~"..curuser)
- cimp.expand_env_esc(src, dst, 1024, false, false, NULL)
+ cimp.expand_env_esc(src, dst, 256, false, false, NULL)
local len = string.len(ffi.string(dst))
assert.True(len > 56)
- assert.True(len < 99)
+ assert.True(len < 256)
end)
itp('respects `dstlen` without expansion', function()