Skip to content

Commit 37a5b1b

Browse files
committed
[clang-format] Move the testcase to unittest
1 parent 8bf68f8 commit 37a5b1b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

clang/test/Format/empty-macro.cpp

Lines changed: 0 additions & 5 deletions
This file was deleted.

clang/unittests/Format/MacroCallReconstructorTest.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,19 @@ TEST_F(MacroCallReconstructorTest, Identifier) {
217217
EXPECT_THAT(std::move(Unexp).takeResult(), matchesLine(line(U.consume("X"))));
218218
}
219219

220+
TEST_F(MacroCallReconstructorTest, EmptyExpansion) {
221+
auto Macros = createExpander({"A(x)=y"});
222+
Expansion Exp(Lex, *Macros);
223+
TokenList Call = Exp.expand("A", {""});
224+
225+
MacroCallReconstructor Unexp(0, Exp.getUnexpanded());
226+
Unexp.addLine(line(Exp.getTokens()));
227+
EXPECT_TRUE(Unexp.finished());
228+
Matcher U(Call, Lex);
229+
EXPECT_THAT(std::move(Unexp).takeResult(),
230+
matchesLine(line(U.consume("A()"))));
231+
}
232+
220233
TEST_F(MacroCallReconstructorTest, NestedLineWithinCall) {
221234
auto Macros = createExpander({"C(a)=class X { a; };"});
222235
Expansion Exp(Lex, *Macros);

0 commit comments

Comments
 (0)