From ec730daee9bbdc34e250dea3beb7c15e6e7927dc Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 11 Mar 2017 23:13:09 +0300 Subject: unittests: Do not use which, add data to paths.lua.in instead --- test/helpers.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/helpers.lua') diff --git a/test/helpers.lua b/test/helpers.lua index ecf90869c4..d3dca00385 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -216,8 +216,11 @@ local function which(exe) local pipe = io.popen('which ' .. exe, 'r') local ret = pipe:read('*a') pipe:close() - assert(ret:sub(-1) == '\n') - return ret:sub(1, -2) + if ret == '' then + return nil + else + return ret:sub(1, -2) + end end return { -- cgit