File: test_make_escaping.lua

package info (click to toggle)
premake4 4.3%2Brepack1-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch, trixie
  • size: 1,640 kB
  • ctags: 1,150
  • sloc: ansic: 636; makefile: 69; sh: 2
file content (30 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--
-- tests/actions/make/test_make_escaping.lua
-- Validate the escaping of literal values in Makefiles.
-- Copyright (c) 2010 Jason Perkins and the Premake project
--

	T.make_escaping = { }
	local suite = T.make_escaping


	function suite.Escapes_Spaces()
		test.isequal("Program\\ Files", _MAKE.esc("Program Files"))
	end

	function suite.Escapes_Backslashes()
		test.isequal("Program\\\\Files", _MAKE.esc("Program\\Files"))
	end
	
	function suite.Escapes_Parens()
		test.isequal("Debug\\(x86\\)", _MAKE.esc("Debug(x86)"))
	end
	
	function suite.DoesNotEscape_ShellReplacements()
		test.isequal("-L$(NVSDKCUDA_ROOT)/C/lib", _MAKE.esc("-L$(NVSDKCUDA_ROOT)/C/lib"))
	end
	
	function suite.CanEscape_ShellReplacementCapturesShortest()
		test.isequal("a\\(x\\)b$(ROOT)c\\(y\\)d", _MAKE.esc("a(x)b$(ROOT)c(y)d"))
	end