Mercurial > hg > CbC > CbC_llvm
comparison unittests/Support/MatchersTest.cpp @ 148:63bd29f05246
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 19:46:37 +0900 |
parents | c2174574ed3a |
children |
comparison
equal
deleted
inserted
replaced
146:3fc4d5c3e21e | 148:63bd29f05246 |
---|---|
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/ADT/Optional.h" | |
10 #include "llvm/Testing/Support/SupportHelpers.h" | |
11 #include "gmock/gmock-matchers.h" | |
12 | |
13 using ::testing::_; | |
14 using ::testing::AllOf; | |
15 using ::testing::Gt; | |
16 using ::testing::Lt; | |
17 using ::testing::Not; | |
18 | |
19 namespace { | |
20 TEST(MatchersTest, Optional) { | |
21 EXPECT_THAT(llvm::Optional<int>(llvm::None), Not(llvm::ValueIs(_))); | |
22 EXPECT_THAT(llvm::Optional<int>(10), llvm::ValueIs(10)); | |
23 EXPECT_THAT(llvm::Optional<int>(10), llvm::ValueIs(AllOf(Lt(11), Gt(9)))); | |
24 } | |
25 } // namespace |