aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
index 6b31241..2a3fae0 100644
--- a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
@@ -219,6 +219,16 @@ TEST(LLVMHeaderGuardCheckTest, FixHeaderGuards) {
"", "/llvm-project/clang-tools-extra/clangd/foo.h",
StringRef("header is missing header guard")));
+ // Substitution of characters should not result in a header guard starting
+ // with "_".
+ EXPECT_EQ("#ifndef BAR_H\n"
+ "#define BAR_H\n"
+ "\n"
+ "\n"
+ "#endif\n",
+ runHeaderGuardCheck("", "include/--bar.h",
+ StringRef("header is missing header guard")));
+
#ifdef WIN32
// Check interaction with Windows-style path separators (\).
EXPECT_EQ(