Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: tools/vim/tests/chromium.ycm_extra_conf_unittest.py

Issue 2305443004: YCM: Support Objective-C and Objective-C++ (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/vim/chromium.ycm_extra_conf.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vim/tests/chromium.ycm_extra_conf_unittest.py
diff --git a/tools/vim/tests/chromium.ycm_extra_conf_unittest.py b/tools/vim/tests/chromium.ycm_extra_conf_unittest.py
index bb3dca421b8c3a05a66e9ae62d2d971ddc1a8e36..63aa5e1832773863ebcfdadd3424e1a052ee7a45 100755
--- a/tools/vim/tests/chromium.ycm_extra_conf_unittest.py
+++ b/tools/vim/tests/chromium.ycm_extra_conf_unittest.py
@@ -53,6 +53,13 @@ def CreateFile(path,
statinfo = os.stat(path)
os.chmod(path, statinfo.st_mode | stat.S_IXUSR)
+def GetLastLangFlag(flags):
+ lastLang = None
+ for i, flag in enumerate(flags):
+ if flag =='-x':
+ lastLang = flags[i+1]
+ return lastLang
+
class Chromium_ycmExtraConfTest(unittest.TestCase):
def SetUpFakeChromeTreeBelowPath(self):
@@ -225,6 +232,18 @@ class Chromium_ycmExtraConfTest(unittest.TestCase):
'-I[OUT]/tag-default'
])
+ def testGetFlagsForFileForUnknownObjcFile(self):
+ result = self.ycm_extra_conf.FlagsForFile(
+ os.path.join(self.chrome_root, 'nonexistent.m'))
+ self.assertTrue(result)
+ self.assertEqual(GetLastLangFlag(result['flags']), 'objective-c')
+
+ def testGetFlagsForFileForUnknownObjcppFile(self):
+ result = self.ycm_extra_conf.FlagsForFile(
+ os.path.join(self.chrome_root, 'nonexistent.mm'))
+ self.assertTrue(result)
+ self.assertEqual(GetLastLangFlag(result['flags']), 'objective-c++')
+
def testGetFlagsForFileForUnknownHeaderFile(self):
result = self.ycm_extra_conf.FlagsForFile(
os.path.join(self.chrome_root, 'nonexistent.h'))
« no previous file with comments | « tools/vim/chromium.ycm_extra_conf.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698