From 461a67fa15370a9ec88f8f8a240bf7c123bb2029 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:11:37 +0000 Subject: Vendor import of clang trunk r321017: https://llvm.org/svn/llvm-project/cfe/trunk@321017 --- unittests/Format/FormatTestObjC.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'unittests/Format/FormatTestObjC.cpp') diff --git a/unittests/Format/FormatTestObjC.cpp b/unittests/Format/FormatTestObjC.cpp index 1f9fc451d213..4220b44b4c47 100644 --- a/unittests/Format/FormatTestObjC.cpp +++ b/unittests/Format/FormatTestObjC.cpp @@ -79,6 +79,17 @@ TEST(FormatTestObjCStyle, DetectsObjCInHeaders) { ASSERT_TRUE((bool)Style); EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language); + Style = getStyle("LLVM", "a.h", "none", "@interface\n" + "@end\n" + "//comment"); + ASSERT_TRUE((bool)Style); + EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language); + + Style = getStyle("LLVM", "a.h", "none", "@interface\n" + "@end //comment"); + ASSERT_TRUE((bool)Style); + EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language); + // No recognizable ObjC. Style = getStyle("LLVM", "a.h", "none", "void f() {}"); ASSERT_TRUE((bool)Style); -- cgit v1.2.3