//===--- BracketTest.cpp -------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "clang-pseudo/Bracket.h" #include "clang-pseudo/Token.h" #include "clang/Basic/LangOptions.h" #include "llvm/Testing/Annotations/Annotations.h" #include "gmock/gmock.h" #include "gtest/gtest.h" namespace clang { namespace pseudo { // Return a version of Code with each paired bracket marked with ^. std::string decorate(llvm::StringRef Code, const TokenStream &Stream) { … } // Checks that the brackets matched in Stream are those annotated in MarkedCode. void verifyMatchedSet(llvm::StringRef Code, llvm::StringRef MarkedCode, const TokenStream &Stream) { … } // Checks that paired brackets within the stream nest properly. void verifyNesting(const TokenStream &Stream) { … } // Checks that ( pairs with a ) on its right, etc. void verifyMatchKind(const TokenStream &Stream) { … } // Verifies an expected bracket pairing like: // ^( [ ^) // The input is annotated code, with the brackets expected to be matched marked. // // The input doesn't specify which bracket matches with which, but we verify: // - exactly the marked subset are paired // - ( is paired to a later ), etc // - brackets properly nest // This uniquely determines the bracket structure, so we indirectly verify it. // If particular tests should emphasize which brackets are paired, use comments. void verifyBrackets(llvm::StringRef MarkedCode) { … } TEST(Bracket, SimplePair) { … } } // namespace pseudo } // namespace clang