StringPool.cpp 837 B

123456789101112131415161718192021222324252627282930
  1. //===- llvm/unittest/Support/StringPoiil.cpp - StringPool tests -----------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "llvm/Support/StringPool.h"
  9. #include "gtest/gtest.h"
  10. using namespace llvm;
  11. namespace {
  12. TEST(PooledStringPtrTest, OperatorEquals) {
  13. StringPool pool;
  14. const PooledStringPtr a = pool.intern("a");
  15. const PooledStringPtr b = pool.intern("b");
  16. EXPECT_FALSE(a == b);
  17. }
  18. TEST(PooledStringPtrTest, OperatorNotEquals) {
  19. StringPool pool;
  20. const PooledStringPtr a = pool.intern("a");
  21. const PooledStringPtr b = pool.intern("b");
  22. EXPECT_TRUE(a != b);
  23. }
  24. }