From c76feb338a14a0e6dea494c18fb2d22f474cfc0e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 6 Sep 2014 17:08:10 -0400 Subject: [PATCH] unit tests: helpers.lua: hack to avoid empty popen() result --- test/unit/helpers.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua index 5ad0766d61..eaf386d9cf 100644 --- a/test/unit/helpers.lua +++ b/test/unit/helpers.lua @@ -64,10 +64,15 @@ function cimport(...) return libnvim end - -- preprocess the header - local stream = Preprocess.preprocess_stream(unpack(paths)) - local body = stream:read("*a") - stream:close() + -- require 'pl.pretty'.dump(paths) + local body = nil + for i=1, 3 do + local stream = Preprocess.preprocess_stream(unpack(paths)) + body = stream:read("*a") + stream:close() + if body ~= nil then break end + end + -- require 'pl.pretty'.dump(body) -- format it (so that the lines are "unique" statements), also filter out -- Objective-C blocks