aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/msgpack_spec.lua6
-rw-r--r--test/unit/os/env_spec.lua4
-rw-r--r--test/unit/os/shell_spec.lua24
-rw-r--r--test/unit/profile_spec.lua4
-rw-r--r--test/unit/tempfile_spec.lua4
5 files changed, 21 insertions, 21 deletions
diff --git a/test/unit/msgpack_spec.lua b/test/unit/msgpack_spec.lua
index bd663a3c75..f9fde00a85 100644
--- a/test/unit/msgpack_spec.lua
+++ b/test/unit/msgpack_spec.lua
@@ -51,11 +51,11 @@ describe('msgpack', function()
unpacker_goto(unpacker, payload, payload:len() - 1)
local finished = unpacker_advance(unpacker)
- eq(finished, false)
+ eq(false, finished)
unpacker[0].read_size = unpacker[0].read_size + 1
finished = unpacker_advance(unpacker)
- eq(finished, true)
+ eq(true, finished)
end
)
@@ -73,7 +73,7 @@ describe('msgpack', function()
'\x93\x02\xa6\x72\x65\x64\x72\x61\x77\x91\x92\xa9\x67\x72\x69\x64\x5f\x6c\x69\x6e\x65\x95\x02\x00\x00\x90\xc2'
)
local finished = unpacker_advance(unpacker)
- eq(finished, true)
+ eq(true, finished)
end)
end)
end)
diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua
index 2c638fcb37..310201b8c3 100644
--- a/test/unit/os/env_spec.lua
+++ b/test/unit/os/env_spec.lua
@@ -306,9 +306,9 @@ describe('env.c', function()
-- expand_env_esc SHOULD NOT expand the variable if there is not enough space to
-- contain the result
for i = 0, 3 do
- eq(output[i], input[i])
+ eq(input[i], output[i])
end
- eq(output[4], 0)
+ eq(0, output[4])
end)
end)
end)
diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua
index ae162f2317..05f965585a 100644
--- a/test/unit/os/shell_spec.lua
+++ b/test/unit/os/shell_spec.lua
@@ -125,9 +125,9 @@ describe('shell functions', function()
cimported.p_sxe = to_cstr('"&|<>()@^')
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo &|<>()@^'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), '(echo ^&^|^<^>^(^)^@^^)')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('(echo ^&^|^<^>^(^)^@^^)', ffi.string(argv[2]))
eq(nil, argv[3])
end)
@@ -136,9 +136,9 @@ describe('shell functions', function()
cimported.p_sxe = to_cstr('"&|<>()@^')
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo -n some text'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), '"(echo -n some text)"')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('"(echo -n some text)"', ffi.string(argv[2]))
eq(nil, argv[3])
end)
@@ -147,17 +147,17 @@ describe('shell functions', function()
cimported.p_sxe = to_cstr('')
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo -n some text'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), '"echo -n some text"')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('"echo -n some text"', ffi.string(argv[2]))
eq(nil, argv[3])
end)
itp('with empty shellxquote/shellxescape', function()
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo -n some text'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), 'echo -n some text')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('echo -n some text', ffi.string(argv[2]))
eq(nil, argv[3])
end)
end)
diff --git a/test/unit/profile_spec.lua b/test/unit/profile_spec.lua
index 011d3632d5..c7dc7db189 100644
--- a/test/unit/profile_spec.lua
+++ b/test/unit/profile_spec.lua
@@ -229,7 +229,7 @@ describe('profiling related functions', function()
describe('profile_msg', function()
itp('prints the zero time as 0.00000', function()
local str = trim(profile_msg(profile_zero()))
- eq(str, '0.000000')
+ eq('0.000000', str)
end)
itp('prints the time passed, in seconds.microsends', function()
@@ -245,7 +245,7 @@ describe('profiling related functions', function()
-- zero seconds have passed (if this is not true, either LuaJIT is too
-- slow or the profiling functions are too slow and need to be fixed)
- eq(s, '0')
+ eq('0', s)
-- more or less the same goes for the microsecond part, if it doesn't
-- start with 0, it's too slow.
diff --git a/test/unit/tempfile_spec.lua b/test/unit/tempfile_spec.lua
index e35490a561..bb0e56d640 100644
--- a/test/unit/tempfile_spec.lua
+++ b/test/unit/tempfile_spec.lua
@@ -28,7 +28,7 @@ describe('tempfile related functions', function()
assert.True(dir ~= nil and dir:len() > 0)
-- os_file_is_writable returns 2 for a directory which we have rights
-- to write into.
- eq(lib.os_file_is_writable(helpers.to_cstr(dir)), 2)
+ eq(2, lib.os_file_is_writable(helpers.to_cstr(dir)))
for entry in vim.fs.dir(dir) do
assert.True(entry == '.' or entry == '..')
end
@@ -57,7 +57,7 @@ describe('tempfile related functions', function()
itp('generate file name in Nvim own temp directory', function()
local dir = vim_gettempdir()
local file = vim_tempname()
- eq(string.sub(file, 1, string.len(dir)), dir)
+ eq(dir, string.sub(file, 1, string.len(dir)))
end)
end)
end)