2010-10-11 16:25:55 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/make/test_make_escaping.lua
|
|
|
|
-- Validate the escaping of literal values in Makefiles.
|
2012-05-18 00:41:28 +00:00
|
|
|
-- Copyright (c) 2010-2012 Jason Perkins and the Premake project
|
2010-10-11 16:25:55 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
T.make_escaping = { }
|
|
|
|
local suite = T.make_escaping
|
2012-05-18 00:41:28 +00:00
|
|
|
local make = premake.make
|
2010-10-11 16:25:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
function suite.Escapes_Spaces()
|
2012-06-12 19:57:45 +00:00
|
|
|
test.isequal([[Program\ Files]], make.esc([[Program Files]]))
|
2010-10-11 16:25:55 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function suite.Escapes_Backslashes()
|
2012-06-12 19:57:45 +00:00
|
|
|
test.isequal([[Program\\Files]], make.esc([[Program\Files]]))
|
2010-10-11 16:25:55 +00:00
|
|
|
end
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2010-10-11 16:25:55 +00:00
|
|
|
function suite.Escapes_Parens()
|
2012-06-12 19:57:45 +00:00
|
|
|
test.isequal([[Debug\(x86\)]], make.esc([[Debug(x86)]]))
|
2010-10-11 16:25:55 +00:00
|
|
|
end
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2010-10-11 16:25:55 +00:00
|
|
|
function suite.DoesNotEscape_ShellReplacements()
|
2012-06-12 19:57:45 +00:00
|
|
|
test.isequal([[-L$(NVSDKCUDA_ROOT)/C/lib]], make.esc([[-L$(NVSDKCUDA_ROOT)/C/lib]]))
|
2010-10-11 16:25:55 +00:00
|
|
|
end
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2010-10-11 16:25:55 +00:00
|
|
|
function suite.CanEscape_ShellReplacementCapturesShortest()
|
2012-06-12 19:57:45 +00:00
|
|
|
test.isequal([[a\(x\)b$(ROOT)c\(y\)d]], make.esc([[a(x)b$(ROOT)c(y)d]]))
|
2010-10-11 16:25:55 +00:00
|
|
|
end
|
|
|
|
|