[llvm] [NFC][Support] Add RadixTree (PR #164524)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 23 19:39:10 PDT 2025
================
@@ -0,0 +1,372 @@
+//===- llvm/unittest/ADT/RadixTreeTypeTest.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 "llvm/ADT/RadixTree.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include <iterator>
+#include <list>
+#include <vector>
+
+using namespace llvm;
+namespace {
+
+using ::testing::ElementsAre;
+using ::testing::ElementsAreArray;
+using ::testing::Pair;
+using ::testing::UnorderedElementsAre;
+
+// Test with StringRef.
+
+TEST(RadixTreeTest, Empty) {
+ RadixTree<StringRef, int> T;
+ EXPECT_TRUE(T.empty());
+ EXPECT_EQ(0u, T.size());
----------------
vitalybuka wrote:
For year I wrote this way (expected, actually), every time thinking who it's weird.
But it was changed 8 years ago https://github.com/google/googletest/commit/d629744ec0e08d4e8b27ec18ec8e38ca52fea843 :)
Thanks!
https://github.com/llvm/llvm-project/pull/164524
More information about the llvm-commits
mailing list