fix a multiline comment warning
[folly.git] / folly / test / UnitTest.cpp
1 /*
2  * Copyright 2015-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <folly/Unit.h>
18
19 #include <folly/portability/GTest.h>
20
21 using namespace folly;
22
23 TEST(Unit, operatorEq) {
24   EXPECT_TRUE(Unit{} == Unit{});
25 }
26
27 TEST(Unit, operatorNe) {
28   EXPECT_FALSE(Unit{} != Unit{});
29 }
30
31 TEST(Unit, liftInt) {
32   using lifted = Unit::Lift<int>;
33   using actual = std::is_same<int, lifted::type>;
34   EXPECT_TRUE(actual::value);
35 }
36
37 TEST(Unit, liftUnit) {
38   using lifted = Unit::Lift<Unit>;
39   using actual = std::is_same<Unit, lifted::type>;
40   EXPECT_TRUE(actual::value);
41 }
42
43 TEST(Unit, liftVoid) {
44   using lifted = Unit::Lift<void>;
45   using actual = std::is_same<Unit, lifted::type>;
46   EXPECT_TRUE(actual::value);
47 }
48
49 TEST(Unit, dropInt) {
50   using dropped = Unit::Drop<int>;
51   using actual = std::is_same<int, dropped::type>;
52   EXPECT_TRUE(actual::value);
53 }
54
55 TEST(Unit, dropUnit) {
56   using dropped = Unit::Drop<Unit>;
57   using actual = std::is_same<void, dropped::type>;
58   EXPECT_TRUE(actual::value);
59 }
60
61 TEST(Unit, dropVoid) {
62   using dropped = Unit::Drop<void>;
63   using actual = std::is_same<void, dropped::type>;
64   EXPECT_TRUE(actual::value);
65 }