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 gyp.generator.xcode as xcode 10import unittest 11import sys 12 13 14class TestEscapeXcodeDefine(unittest.TestCase): 15 if sys.platform == "darwin": 16 17 def test_InheritedRemainsUnescaped(self): 18 self.assertEqual(xcode.EscapeXcodeDefine("$(inherited)"), "$(inherited)") 19 20 def test_Escaping(self): 21 self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') 22 23 24if __name__ == "__main__": 25 unittest.main() 26