Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / unittests / Support / MatchersTest.cpp
blob34678ffe109a841a63ec2087afbdf6ed062f1b60
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 //===----------------------------------------------------------------------===//
9 #include "llvm/Testing/Support/SupportHelpers.h"
10 #include "gmock/gmock-matchers.h"
12 using ::testing::_;
13 using ::testing::AllOf;
14 using ::testing::Gt;
15 using ::testing::Lt;
16 using ::testing::Not;
18 namespace {
19 TEST(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))));
24 } // namespace