diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 12:03:25 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 12:04:20 +0000 |
commit | 284e0ad26dd9de90c3a813dd1b357a425eca6bad (patch) | |
tree | 55b60f82154a6aadbd3c53e6441e0b2c590f11f6 /test/unit | |
parent | 56a2ec5c79d49421758319f1a8822cf30f1f8a5e (diff) | |
download | rneovim-284e0ad26dd9de90c3a813dd1b357a425eca6bad.tar.gz rneovim-284e0ad26dd9de90c3a813dd1b357a425eca6bad.tar.bz2 rneovim-284e0ad26dd9de90c3a813dd1b357a425eca6bad.zip |
test: use vim.mpack and vim.uv directly
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/os/fileio_spec.lua | 58 | ||||
-rw-r--r-- | test/unit/os/fs_spec.lua | 64 | ||||
-rw-r--r-- | test/unit/path_spec.lua | 62 |
3 files changed, 92 insertions, 92 deletions
diff --git a/test/unit/os/fileio_spec.lua b/test/unit/os/fileio_spec.lua index 30e4fad88f..385f4fa4b0 100644 --- a/test/unit/os/fileio_spec.lua +++ b/test/unit/os/fileio_spec.lua @@ -1,4 +1,4 @@ -local luv = require('luv') +local uv = vim.uv local helpers = require('test.unit.helpers')(after_each) local itp = helpers.gen_itp(it) @@ -36,8 +36,8 @@ before_each(function() f2:write(fcontents) f2:close() - luv.fs_symlink('file1.dat', linkf) - luv.fs_symlink('broken.dat', linkb) + uv.fs_symlink('file1.dat', linkf) + uv.fs_symlink('broken.dat', linkb) end) after_each(function() @@ -46,7 +46,7 @@ after_each(function() os.remove(linkf) os.remove(linkb) os.remove(filec) - luv.fs_rmdir(dir) + uv.fs_rmdir(dir) end) local function file_open(fname, flags, mode) @@ -120,13 +120,13 @@ describe('file_open_fd', function() eq(0, m.file_close(fp, false)) end) itp('can use file descriptor returned by os_open for writing', function() - eq(nil, luv.fs_stat(filec)) + eq(nil, uv.fs_stat(filec)) local fd = m.os_open(filec, m.kO_WRONLY + m.kO_CREAT, 384) local err, fp = file_open_fd(fd, m.kFileWriteOnly) eq(0, err) eq(4, file_write(fp, 'test')) eq(0, m.file_close(fp, false)) - eq(4, luv.fs_stat(filec).size) + eq(4, uv.fs_stat(filec).size) eq('test', io.open(filec):read('*a')) end) end) @@ -140,13 +140,13 @@ describe('file_open_fd_new', function() eq(0, m.file_free(fp, false)) end) itp('can use file descriptor returned by os_open for writing', function() - eq(nil, luv.fs_stat(filec)) + eq(nil, uv.fs_stat(filec)) local fd = m.os_open(filec, m.kO_WRONLY + m.kO_CREAT, 384) local err, fp = file_open_fd_new(fd, m.kFileWriteOnly) eq(0, err) eq(4, file_write(fp, 'test')) eq(0, m.file_free(fp, false)) - eq(4, luv.fs_stat(filec).size) + eq(4, uv.fs_stat(filec).size) eq('test', io.open(filec):read('*a')) end) end) @@ -155,7 +155,7 @@ describe('file_open', function() itp('can create a rwx------ file with kFileCreate', function() local err, fp = file_open(filec, m.kFileCreate, 448) eq(0, err) - local attrs = luv.fs_stat(filec) + local attrs = uv.fs_stat(filec) eq(33216, attrs.mode) eq(0, m.file_close(fp, false)) end) @@ -163,7 +163,7 @@ describe('file_open', function() itp('can create a rw------- file with kFileCreate', function() local err, fp = file_open(filec, m.kFileCreate, 384) eq(0, err) - local attrs = luv.fs_stat(filec) + local attrs = uv.fs_stat(filec) eq(33152, attrs.mode) eq(0, m.file_close(fp, false)) end) @@ -171,7 +171,7 @@ describe('file_open', function() itp('can create a rwx------ file with kFileCreateOnly', function() local err, fp = file_open(filec, m.kFileCreateOnly, 448) eq(0, err) - local attrs = luv.fs_stat(filec) + local attrs = uv.fs_stat(filec) eq(33216, attrs.mode) eq(0, m.file_close(fp, false)) end) @@ -179,7 +179,7 @@ describe('file_open', function() itp('can create a rw------- file with kFileCreateOnly', function() local err, fp = file_open(filec, m.kFileCreateOnly, 384) eq(0, err) - local attrs = luv.fs_stat(filec) + local attrs = uv.fs_stat(filec) eq(33152, attrs.mode) eq(0, m.file_close(fp, false)) end) @@ -231,7 +231,7 @@ describe('file_open', function() eq(0, err) eq(true, fp.wr) eq(0, m.file_close(fp, false)) - local attrs = luv.fs_stat(file1) + local attrs = uv.fs_stat(file1) eq(0, attrs.size) end) @@ -240,14 +240,14 @@ describe('file_open', function() eq(0, err) eq(true, fp.wr) eq(0, m.file_close(fp, false)) - local attrs = luv.fs_stat(file1) + local attrs = uv.fs_stat(file1) eq(4096, attrs.size) end) itp('fails to create a file with just kFileWriteOnly', function() local err, _ = file_open(filec, m.kFileWriteOnly, 384) eq(m.UV_ENOENT, err) - local attrs = luv.fs_stat(filec) + local attrs = uv.fs_stat(filec) eq(nil, attrs) end) @@ -256,7 +256,7 @@ describe('file_open', function() eq(0, err) eq(true, fp.wr) eq(0, m.file_close(fp, false)) - local attrs = luv.fs_stat(file1) + local attrs = uv.fs_stat(file1) eq(0, attrs.size) end) @@ -297,9 +297,9 @@ describe('file_close', function() eq(0, err) local wsize = file_write(fp, 'test') eq(4, wsize) - eq(0, luv.fs_stat(filec).size) + eq(0, uv.fs_stat(filec).size) eq(0, m.file_close(fp, true)) - eq(wsize, luv.fs_stat(filec).size) + eq(wsize, uv.fs_stat(filec).size) end) end) @@ -309,9 +309,9 @@ describe('file_free', function() eq(0, err) local wsize = file_write(fp, 'test') eq(4, wsize) - eq(0, luv.fs_stat(filec).size) + eq(0, uv.fs_stat(filec).size) eq(0, m.file_free(fp, true)) - eq(wsize, luv.fs_stat(filec).size) + eq(wsize, uv.fs_stat(filec).size) end) end) @@ -320,12 +320,12 @@ describe('file_fsync', function() local err, fp = file_open(filec, m.kFileCreateOnly, 384) eq(0, file_fsync(fp)) eq(0, err) - eq(0, luv.fs_stat(filec).size) + eq(0, uv.fs_stat(filec).size) local wsize = file_write(fp, 'test') eq(4, wsize) - eq(0, luv.fs_stat(filec).size) + eq(0, uv.fs_stat(filec).size) eq(0, file_fsync(fp)) - eq(wsize, luv.fs_stat(filec).size) + eq(wsize, uv.fs_stat(filec).size) eq(0, m.file_close(fp, false)) end) end) @@ -335,12 +335,12 @@ describe('file_flush', function() local err, fp = file_open(filec, m.kFileCreateOnly, 384) eq(0, file_flush(fp)) eq(0, err) - eq(0, luv.fs_stat(filec).size) + eq(0, uv.fs_stat(filec).size) local wsize = file_write(fp, 'test') eq(4, wsize) - eq(0, luv.fs_stat(filec).size) + eq(0, uv.fs_stat(filec).size) eq(0, file_flush(fp)) - eq(wsize, luv.fs_stat(filec).size) + eq(wsize, uv.fs_stat(filec).size) eq(0, m.file_close(fp, false)) end) end) @@ -411,7 +411,7 @@ describe('file_write', function() local wr = file_write(fp, fcontents) eq(#fcontents, wr) eq(0, m.file_close(fp, false)) - eq(wr, luv.fs_stat(filec).size) + eq(wr, uv.fs_stat(filec).size) eq(fcontents, io.open(filec):read('*a')) end) @@ -428,7 +428,7 @@ describe('file_write', function() shift = shift + size end eq(0, m.file_close(fp, false)) - eq(#fcontents, luv.fs_stat(filec).size) + eq(#fcontents, uv.fs_stat(filec).size) eq(fcontents, io.open(filec):read('*a')) end) @@ -445,7 +445,7 @@ describe('file_write', function() shift = shift + size end eq(0, m.file_close(fp, false)) - eq(#fcontents, luv.fs_stat(filec).size) + eq(#fcontents, uv.fs_stat(filec).size) eq(fcontents, io.open(filec):read('*a')) end) end) diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index 0a0aeaa35e..c15cd12fef 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -1,4 +1,4 @@ -local luv = require('luv') +local uv = vim.uv local bit = require('bit') local helpers = require('test.unit.helpers')(after_each) @@ -46,11 +46,11 @@ local function unset_bit(number, to_unset) end local function assert_file_exists(filepath) - neq(nil, luv.fs_stat(filepath)) + neq(nil, uv.fs_stat(filepath)) end local function assert_file_does_not_exist(filepath) - eq(nil, luv.fs_stat(filepath)) + eq(nil, uv.fs_stat(filepath)) end local function os_setperm(filename, perm) @@ -73,9 +73,9 @@ describe('fs.c', function() io.open('unit-test-directory/test.file', 'w'):close() io.open('unit-test-directory/test_2.file', 'w'):close() - luv.fs_symlink('test.file', 'unit-test-directory/test_link.file') + uv.fs_symlink('test.file', 'unit-test-directory/test_link.file') - luv.fs_symlink('non_existing_file.file', 'unit-test-directory/test_broken_link.file') + uv.fs_symlink('non_existing_file.file', 'unit-test-directory/test_broken_link.file') -- The tests are invoked with an absolute path to `busted` executable. absolute_executable = arg[0] -- Split the absolute_executable path into a directory and filename. @@ -88,19 +88,19 @@ describe('fs.c', function() os.remove('unit-test-directory/test_link.file') os.remove('unit-test-directory/test_hlink.file') os.remove('unit-test-directory/test_broken_link.file') - luv.fs_rmdir('unit-test-directory') + uv.fs_rmdir('unit-test-directory') end) describe('os_dirname', function() itp('returns OK and writes current directory to the buffer', function() - local length = string.len(luv.cwd()) + 1 + local length = string.len(uv.cwd()) + 1 local buf = cstr(length, '') eq(OK, fs.os_dirname(buf, length)) - eq(luv.cwd(), ffi.string(buf)) + eq(uv.cwd(), ffi.string(buf)) end) itp('returns FAIL if the buffer is too small', function() - local length = string.len(luv.cwd()) + 1 + local length = string.len(uv.cwd()) + 1 local buf = cstr(length - 1, '') eq(FAIL, fs.os_dirname(buf, length - 1)) end) @@ -201,20 +201,20 @@ describe('fs.c', function() end) itp('returns the absolute path when given an executable relative to the current dir', function() - local old_dir = luv.cwd() + local old_dir = uv.cwd() - luv.chdir(directory) + uv.chdir(directory) -- Rely on currentdir to resolve symlinks, if any. Testing against -- the absolute path taken from arg[0] may result in failure where -- the path has a symlink in it. - local canonical = luv.cwd() .. '/' .. executable_name + local canonical = uv.cwd() .. '/' .. executable_name local expected = exe(canonical) local relative_executable = './' .. executable_name local res = exe(relative_executable) -- Don't test yet; we need to chdir back first. - luv.chdir(old_dir) + uv.chdir(old_dir) eq(expected, res) end) end) @@ -276,11 +276,11 @@ describe('fs.c', function() describe('os_fchown', function() local filename = 'unit-test-directory/test.file' itp('does not change owner and group if respective IDs are equal to -1', function() - local uid = luv.fs_stat(filename).uid - local gid = luv.fs_stat(filename).gid + local uid = uv.fs_stat(filename).uid + local gid = uv.fs_stat(filename).gid eq(0, os_fchown(filename, -1, -1)) - eq(uid, luv.fs_stat(filename).uid) - return eq(gid, luv.fs_stat(filename).gid) + eq(uid, uv.fs_stat(filename).uid) + return eq(gid, uv.fs_stat(filename).gid) end) -- Some systems may not have `id` utility. @@ -290,7 +290,7 @@ describe('fs.c', function() itp( 'owner of a file may change the group of the file to any group of which that owner is a member', function() - local file_gid = luv.fs_stat(filename).gid + local file_gid = uv.fs_stat(filename).gid -- Gets ID of any group of which current user is a member except the -- group that owns the file. @@ -305,7 +305,7 @@ describe('fs.c', function() -- In that case we can not perform this test. if new_gid then eq(0, (os_fchown(filename, -1, new_gid))) - eq(new_gid, luv.fs_stat(filename).gid) + eq(new_gid, uv.fs_stat(filename).gid) end end ) @@ -554,7 +554,7 @@ describe('fs.c', function() --create the file local fd = os_open(new_file, ffi.C.kO_CREAT, tonumber('700', 8)) --verify permissions - eq(33216, luv.fs_stat(new_file).mode) + eq(33216, uv.fs_stat(new_file).mode) eq(0, os_close(fd)) end) @@ -563,7 +563,7 @@ describe('fs.c', function() --create the file local fd = os_open(new_file, ffi.C.kO_CREAT, tonumber('600', 8)) --verify permissions - eq(33152, luv.fs_stat(new_file).mode) + eq(33152, uv.fs_stat(new_file).mode) eq(0, os_close(fd)) end) @@ -793,7 +793,7 @@ describe('fs.c', function() eq(false, (os_isdir('unit-test-directory/new-dir'))) eq(0, (os_mkdir('unit-test-directory/new-dir', mode))) eq(true, (os_isdir('unit-test-directory/new-dir'))) - luv.fs_rmdir('unit-test-directory/new-dir') + uv.fs_rmdir('unit-test-directory/new-dir') end) end) @@ -831,7 +831,7 @@ describe('fs.c', function() eq(nil, failed_dir) ok(endswith(created_dir, 'unit-test-directory/new-dir-recurse')) eq(true, os_isdir('unit-test-directory/new-dir-recurse')) - luv.fs_rmdir('unit-test-directory/new-dir-recurse') + uv.fs_rmdir('unit-test-directory/new-dir-recurse') eq(false, os_isdir('unit-test-directory/new-dir-recurse')) end) @@ -843,7 +843,7 @@ describe('fs.c', function() eq(nil, failed_dir) ok(endswith(created_dir, 'unit-test-directory/new-dir-recurse')) eq(true, os_isdir('unit-test-directory/new-dir-recurse')) - luv.fs_rmdir('unit-test-directory/new-dir-recurse') + uv.fs_rmdir('unit-test-directory/new-dir-recurse') eq(false, os_isdir('unit-test-directory/new-dir-recurse')) end) @@ -855,7 +855,7 @@ describe('fs.c', function() eq(nil, failed_dir) ok(endswith(created_dir, 'unit-test-directory/new-dir-recurse')) eq(true, os_isdir('unit-test-directory/new-dir-recurse')) - luv.fs_rmdir('unit-test-directory/new-dir-recurse') + uv.fs_rmdir('unit-test-directory/new-dir-recurse') eq(false, os_isdir('unit-test-directory/new-dir-recurse')) end) @@ -870,10 +870,10 @@ describe('fs.c', function() eq(true, os_isdir('unit-test-directory/new-dir-recurse/1')) eq(true, os_isdir('unit-test-directory/new-dir-recurse/1/2')) eq(true, os_isdir('unit-test-directory/new-dir-recurse/1/2/3')) - luv.fs_rmdir('unit-test-directory/new-dir-recurse/1/2/3') - luv.fs_rmdir('unit-test-directory/new-dir-recurse/1/2') - luv.fs_rmdir('unit-test-directory/new-dir-recurse/1') - luv.fs_rmdir('unit-test-directory/new-dir-recurse') + uv.fs_rmdir('unit-test-directory/new-dir-recurse/1/2/3') + uv.fs_rmdir('unit-test-directory/new-dir-recurse/1/2') + uv.fs_rmdir('unit-test-directory/new-dir-recurse/1') + uv.fs_rmdir('unit-test-directory/new-dir-recurse') eq(false, os_isdir('unit-test-directory/new-dir-recurse')) end) end) @@ -1038,7 +1038,7 @@ describe('fs.c', function() file:write('some bytes to get filesize != 0') file:flush() file:close() - local size = luv.fs_stat(path).size + local size = uv.fs_stat(path).size local info = file_info_new() assert.is_true(fs.os_fileinfo(path, info)) eq(size, fs.os_fileinfo_size(info)) @@ -1052,7 +1052,7 @@ describe('fs.c', function() local info = file_info_new() assert.is_true(fs.os_fileinfo(path, info)) eq(1, fs.os_fileinfo_hardlinks(info)) - luv.fs_link(path, path_link) + uv.fs_link(path, path_link) assert.is_true(fs.os_fileinfo(path, info)) eq(2, fs.os_fileinfo_hardlinks(info)) end) @@ -1061,7 +1061,7 @@ describe('fs.c', function() describe('os_fileinfo_blocksize', function() itp('returns the correct blocksize of a file', function() local path = 'unit-test-directory/test.file' - local blksize = luv.fs_stat(path).blksize + local blksize = uv.fs_stat(path).blksize local info = file_info_new() assert.is_true(fs.os_fileinfo(path, info)) if blksize then diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua index 3ed25b0ba7..c564ec119e 100644 --- a/test/unit/path_spec.lua +++ b/test/unit/path_spec.lua @@ -1,4 +1,4 @@ -local luv = require('luv') +local uv = vim.uv local helpers = require('test.unit.helpers')(after_each) local itp = helpers.gen_itp(it) @@ -27,7 +27,7 @@ describe('path.c', function() end) teardown(function() - luv.fs_rmdir('unit-test-directory') + uv.fs_rmdir('unit-test-directory') end) local function path_full_dir_name(directory, buf, len) @@ -37,34 +37,34 @@ describe('path.c', function() before_each(function() -- Create empty string buffer which will contain the resulting path. - length = string.len(luv.cwd()) + 22 + length = string.len(uv.cwd()) + 22 buffer = cstr(length, '') end) itp('returns the absolute directory name of a given relative one', function() local result = path_full_dir_name('..', buffer, length) eq(OK, result) - local old_dir = luv.cwd() - luv.chdir('..') - local expected = luv.cwd() - luv.chdir(old_dir) + local old_dir = uv.cwd() + uv.chdir('..') + local expected = uv.cwd() + uv.chdir(old_dir) eq(expected, (ffi.string(buffer))) end) itp('returns the current directory name if the given string is empty', function() eq(OK, (path_full_dir_name('', buffer, length))) - eq(luv.cwd(), (ffi.string(buffer))) + eq(uv.cwd(), (ffi.string(buffer))) end) itp('works with a normal relative dir', function() local result = path_full_dir_name('unit-test-directory', buffer, length) - eq(luv.cwd() .. '/unit-test-directory', (ffi.string(buffer))) + eq(uv.cwd() .. '/unit-test-directory', (ffi.string(buffer))) eq(OK, result) end) itp('works with a non-existing relative dir', function() local result = path_full_dir_name('does-not-exist', buffer, length) - eq(luv.cwd() .. '/does-not-exist', (ffi.string(buffer))) + eq(uv.cwd() .. '/does-not-exist', (ffi.string(buffer))) eq(OK, result) end) @@ -270,27 +270,27 @@ describe('path.c', function() end) describe('path_try_shorten_fname', function() - local cwd = luv.cwd() + local cwd = uv.cwd() before_each(function() mkdir('ut_directory') end) after_each(function() - luv.chdir(cwd) - luv.fs_rmdir('ut_directory') + uv.chdir(cwd) + uv.fs_rmdir('ut_directory') end) describe('path_try_shorten_fname', function() itp('returns shortened path if possible', function() - luv.chdir('ut_directory') - local full = to_cstr(luv.cwd() .. '/subdir/file.txt') + uv.chdir('ut_directory') + local full = to_cstr(uv.cwd() .. '/subdir/file.txt') eq('subdir/file.txt', (ffi.string(cimp.path_try_shorten_fname(full)))) end) itp('returns `full_path` if a shorter version is not possible', function() - local old = luv.cwd() - luv.chdir('ut_directory') + local old = uv.cwd() + uv.chdir('ut_directory') local full = old .. '/subdir/file.txt' eq(full, (ffi.string(cimp.path_try_shorten_fname(to_cstr(full))))) end) @@ -302,7 +302,7 @@ describe('path_try_shorten_fname', function() end) describe('path.c path_guess_exepath', function() - local cwd = luv.cwd() + local cwd = uv.cwd() for _, name in ipairs({ './nvim', '.nvim', 'foo/nvim' }) do itp('"' .. name .. '" returns name catenated with CWD', function() @@ -370,7 +370,7 @@ describe('path.c', function() teardown(function() os.remove('unit-test-directory/test.file') - luv.fs_rmdir('unit-test-directory') + uv.fs_rmdir('unit-test-directory') end) describe('vim_FullName', function() @@ -422,7 +422,7 @@ describe('path.c', function() end) itp('concatenates filename if it does not contain a slash', function() - local expected = luv.cwd() .. '/test.file' + local expected = uv.cwd() .. '/test.file' local filename = 'test.file' local buflen = get_buf_len(expected, filename) local do_expand = 1 @@ -432,7 +432,7 @@ describe('path.c', function() end) itp('concatenates directory name if it does not contain a slash', function() - local expected = luv.cwd() .. '/..' + local expected = uv.cwd() .. '/..' local filename = '..' local buflen = get_buf_len(expected, filename) local do_expand = 1 @@ -444,10 +444,10 @@ describe('path.c', function() itp( 'enters given directory (instead of just concatenating the strings) if possible and if path contains a slash', function() - local old_dir = luv.cwd() - luv.chdir('..') - local expected = luv.cwd() .. '/test.file' - luv.chdir(old_dir) + local old_dir = uv.cwd() + uv.chdir('..') + local expected = uv.cwd() .. '/test.file' + uv.chdir(old_dir) local filename = '../test.file' local buflen = get_buf_len(expected, filename) local do_expand = 1 @@ -477,7 +477,7 @@ describe('path.c', function() end) itp('works with some "normal" relative path with directories', function() - local expected = luv.cwd() .. '/unit-test-directory/test.file' + local expected = uv.cwd() .. '/unit-test-directory/test.file' local filename = 'unit-test-directory/test.file' local buflen = get_buf_len(expected, filename) local do_expand = 1 @@ -487,7 +487,7 @@ describe('path.c', function() end) itp('does not modify the given filename', function() - local expected = luv.cwd() .. '/unit-test-directory/test.file' + local expected = uv.cwd() .. '/unit-test-directory/test.file' local filename = to_cstr('unit-test-directory/test.file') local buflen = string.len(expected) + 1 local buf = cstr(buflen, '') @@ -510,7 +510,7 @@ describe('path.c', function() end) itp('does not remove trailing slash from non-existing relative directory #20847', function() - local expected = luv.cwd() .. '/non_existing_dir/' + local expected = uv.cwd() .. '/non_existing_dir/' local filename = 'non_existing_dir/' local buflen = get_buf_len(expected, filename) local do_expand = 1 @@ -520,7 +520,7 @@ describe('path.c', function() end) itp('expands "./" to the current directory #7117', function() - local expected = luv.cwd() .. '/unit-test-directory/test.file' + local expected = uv.cwd() .. '/unit-test-directory/test.file' local filename = './unit-test-directory/test.file' local buflen = get_buf_len(expected, filename) local do_expand = 1 @@ -530,7 +530,7 @@ describe('path.c', function() end) itp('collapses "foo/../foo" to "foo" #7117', function() - local expected = luv.cwd() .. '/unit-test-directory/test.file' + local expected = uv.cwd() .. '/unit-test-directory/test.file' local filename = 'unit-test-directory/../unit-test-directory/test.file' local buflen = get_buf_len(expected, filename) local do_expand = 1 @@ -551,7 +551,7 @@ describe('path.c', function() mkdir('CamelCase') end) after_each(function() - luv.fs_rmdir('CamelCase') + uv.fs_rmdir('CamelCase') end) if ffi.os == 'Windows' or ffi.os == 'OSX' then |