summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp')
-rw-r--r--clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp b/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp
index 53601463cc5..e69a408c085 100644
--- a/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp
+++ b/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp
@@ -126,10 +126,20 @@ TEST(IncludeFixer, MinimizeInclude) {
runIncludeFixer("a::b::foo bar;\n", IncludePath));
}
-#if 0
+#ifndef _WIN32
// It doesn't pass for targeting win32. Investigating.
TEST(IncludeFixer, NestedName) {
EXPECT_EQ("#include \"dir/otherdir/qux.h\"\n"
+ "int x = a::b::foo(0);\n",
+ runIncludeFixer("int x = a::b::foo(0);\n"));
+
+ // FIXME: Handle simple macros.
+ EXPECT_EQ("#define FOO a::b::foo\nint x = FOO;\n",
+ runIncludeFixer("#define FOO a::b::foo\nint x = FOO;\n"));
+ EXPECT_EQ("#define FOO(x) a::##x\nint x = FOO(b::foo);\n",
+ runIncludeFixer("#define FOO(x) a::##x\nint x = FOO(b::foo);\n"));
+
+ EXPECT_EQ("#include \"dir/otherdir/qux.h\"\n"
"namespace a {}\nint a = a::b::foo(0);\n",
runIncludeFixer("namespace a {}\nint a = a::b::foo(0);\n"));
}
OpenPOWER on IntegriCloud