codekingpro/portable-devtools
114k
1#!/usr/bin/env python3
2
3# Copyright (c) 2013 Google Inc. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7"""Unit tests for the xcode.py file."""
8
9import sys
10import unittest
11
12from gyp.generator import xcode
13
14
15class TestEscapeXcodeDefine(unittest.TestCase):
16 if sys.platform == "darwin":
17
18 def test_InheritedRemainsUnescaped(self):
19 self.assertEqual(xcode.EscapeXcodeDefine("$(inherited)"), "$(inherited)")
20
21 def test_Escaping(self):
22 self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\')
23
24
25if __name__ == "__main__":
26 unittest.main()
27 