aboutsummaryrefslogtreecommitdiff
path: root/test/unit/preprocess.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-09-06 18:36:00 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-09-11 05:17:52 +0000
commitf6088e79b098791dc04e42602692ab2bdd08ee78 (patch)
tree7956b881e4ee7c91fbf9e15a6668a0ed9414cae3 /test/unit/preprocess.lua
parentc76feb338a14a0e6dea494c18fb2d22f474cfc0e (diff)
downloadrneovim-f6088e79b098791dc04e42602692ab2bdd08ee78.tar.gz
rneovim-f6088e79b098791dc04e42602692ab2bdd08ee78.tar.bz2
rneovim-f6088e79b098791dc04e42602692ab2bdd08ee78.zip
unit tests: avoid global scope; add missing cimports
temporarily comment out call to vim_deltempdir() to avoid segfault
Diffstat (limited to 'test/unit/preprocess.lua')
-rw-r--r--test/unit/preprocess.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/preprocess.lua b/test/unit/preprocess.lua
index 2405270328..f17c7ba666 100644
--- a/test/unit/preprocess.lua
+++ b/test/unit/preprocess.lua
@@ -23,7 +23,7 @@ table.insert(ccs, {path = "/usr/bin/env clang", type = "clang"})
table.insert(ccs, {path = "/usr/bin/env icc", type = "gcc"})
local quote_me = '[^%w%+%-%=%@%_%/]' -- complement (needn't quote)
-function shell_quote(str)
+local function shell_quote(str)
if string.find(str, quote_me) or str == '' then
return "'" .. string.gsub(str, "'", [['"'"']]) .. "'"
else
@@ -32,7 +32,7 @@ function shell_quote(str)
end
-- parse Makefile format dependencies into a Lua table
-function parse_make_deps(deps)
+local function parse_make_deps(deps)
-- remove line breaks and line concatenators
deps = deps:gsub("\n", ""):gsub("\\", "")
-- remove the Makefile "target:" element
@@ -70,7 +70,7 @@ end
-- produces:
-- #include "vim.h"
-- #include "memory.h"
-function headerize(headers, global)
+local function headerize(headers, global)
local pre = '"'
local post = pre
if global then
@@ -166,7 +166,7 @@ local type_to_class = {
-- find the best cc. If os.exec causes problems on windows (like popping up
-- a console window) we might consider using something like this:
-- http://scite-ru.googlecode.com/svn/trunk/pack/tools/LuaLib/shell.html#exec
-function find_best_cc(ccs)
+local function find_best_cc(ccs)
for _, meta in pairs(ccs) do
local version = io.popen(tostring(meta.path) .. " -v 2>&1")
version:close()