Author: Owen Pan Date: 2024-05-13T19:45:11-07:00 New Revision: e20800c16f0570562fea31e9a02d65ba56e6858a
URL: https://github.com/llvm/llvm-project/commit/e20800c16f0570562fea31e9a02d65ba56e6858a DIFF: https://github.com/llvm/llvm-project/commit/e20800c16f0570562fea31e9a02d65ba56e6858a.diff LOG: [clang-format][NFC] Test IsQualifier only needs to call the lexer Added: Modified: clang/unittests/Format/QualifierFixerTest.cpp Removed: ################################################################################ diff --git a/clang/unittests/Format/QualifierFixerTest.cpp b/clang/unittests/Format/QualifierFixerTest.cpp index 1e997bb06b867..4ddeef50f5f78 100644 --- a/clang/unittests/Format/QualifierFixerTest.cpp +++ b/clang/unittests/Format/QualifierFixerTest.cpp @@ -1055,7 +1055,9 @@ TEST_F(QualifierFixerTest, IsQualifierType) { ConfiguredTokens.push_back(tok::kw_constexpr); ConfiguredTokens.push_back(tok::kw_friend); - auto Tokens = annotate( + TestLexer lexer{Allocator, Buffers}; + + auto Tokens = lexer.lex( "const static inline auto restrict int double long constexpr friend"); ASSERT_EQ(Tokens.size(), 11u) << Tokens; @@ -1081,7 +1083,7 @@ TEST_F(QualifierFixerTest, IsQualifierType) { EXPECT_TRUE(isQualifierOrType(Tokens[8])); EXPECT_TRUE(isQualifierOrType(Tokens[9])); - auto NotTokens = annotate("for while do Foo Bar "); + auto NotTokens = lexer.lex("for while do Foo Bar "); ASSERT_EQ(NotTokens.size(), 6u) << Tokens; EXPECT_FALSE(isConfiguredQualifierOrType(NotTokens[0], ConfiguredTokens)); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits