1//===----- unittests/MatchersTest.cpp -------------------------------------===//
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
9#include "llvm/Testing/Support/SupportHelpers.h"
10#include "gmock/gmock-matchers.h"
11
12using ::testing::_;
13using ::testing::AllOf;
14using ::testing::Gt;
15using ::testing::Lt;
16using ::testing::Not;
17
18namespace {
19TEST(MatchersTest, Optional) {
20 EXPECT_THAT(std::optional<int>(std::nullopt), Not(llvm::ValueIs(_)));
21 EXPECT_THAT(std::optional<int>(10), llvm::ValueIs(10));
22 EXPECT_THAT(std::optional<int>(10), llvm::ValueIs(AllOf(Lt(11), Gt(9))));
23}
24} // namespace
25

source code of llvm/unittests/Support/MatchersTest.cpp