Skip to content

Commit

Permalink
Fix an early exit condition in test-tty.lua
Browse files Browse the repository at this point in the history
When running tests with Lua instead of LuaJIT, a misleading message is output.
This is because pcall returns false and an error (i.e., a string value) here.
  • Loading branch information
rdw-software authored and squeek502 committed Nov 6, 2024
1 parent 9299a4b commit e2d3d18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test-tty.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- come from https://github.com/libuv/libuv/blob/v1.x/test/test-tty.c
local _, ffi = pcall(require, 'ffi')
if not ffi then
print('skip, without luajit ffi')
local success, ffi = pcall(require, 'ffi')
if not success then
print('Skipped test-tty: LuaJIT FFI not found')
return
end

if not (ffi.os == "Linux" or ffi.os == "OSX") then
print('skip, not on linux or macos')
print('Skipped test-tty: Not on Linux or macOS')
return
end

Expand Down

0 comments on commit e2d3d18

Please sign in to comment.