aboutsummaryrefslogtreecommitdiff
path: root/test/unit/rbuffer_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-12 02:54:23 +0300
committerZyX <kp-pav@yandex.ru>2017-03-12 02:54:23 +0300
commitbf68907778aba402ead678a6846f865d29e666d8 (patch)
treeed06588dcda721fd9f697de2d28af7c894594fbb /test/unit/rbuffer_spec.lua
parent9d1b439fb7c146d9754c0893750effa03b46d6df (diff)
downloadrneovim-bf68907778aba402ead678a6846f865d29e666d8.tar.gz
rneovim-bf68907778aba402ead678a6846f865d29e666d8.tar.bz2
rneovim-bf68907778aba402ead678a6846f865d29e666d8.zip
unittests: Use more adequate names for some functions
Diffstat (limited to 'test/unit/rbuffer_spec.lua')
-rw-r--r--test/unit/rbuffer_spec.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/unit/rbuffer_spec.lua b/test/unit/rbuffer_spec.lua
index 9b5927cae6..e9104dd5c4 100644
--- a/test/unit/rbuffer_spec.lua
+++ b/test/unit/rbuffer_spec.lua
@@ -5,7 +5,7 @@ local eq = helpers.eq
local ffi = helpers.ffi
local cstr = helpers.cstr
local to_cstr = helpers.to_cstr
-local deferred_call = helpers.deferred_call
+local child_call_once = helpers.child_call_once
local rbuffer = helpers.cimport("./test/unit/fixtures/rbuffer.h")
@@ -32,11 +32,13 @@ describe('rbuffer functions', function()
return ffi.string(rbuffer.rbuffer_get(rbuf, idx), 1)
end
- before_each(deferred_call(function()
- rbuf = ffi.gc(rbuffer.rbuffer_new(capacity), rbuffer.rbuffer_free)
- -- fill the internal buffer with the character '0' to simplify inspecting
- ffi.C.memset(rbuf.start_ptr, string.byte('0'), capacity)
- end))
+ before_each(function()
+ child_call_once(function()
+ rbuf = ffi.gc(rbuffer.rbuffer_new(capacity), rbuffer.rbuffer_free)
+ -- fill the internal buffer with the character '0' to simplify inspecting
+ ffi.C.memset(rbuf.start_ptr, string.byte('0'), capacity)
+ end)
+ end)
describe('RBUFFER_UNTIL_FULL', function()
local chunks