join_test.cc
Go to the documentation of this file.
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
16 
17 #include <tuple>
18 #include <utility>
19 
20 #include "gtest/gtest.h"
21 
23 
24 namespace grpc_core {
25 
26 TEST(JoinTest, Join1) {
27  EXPECT_EQ(Join([] { return 3; })(),
28  (Poll<std::tuple<int>>(std::make_tuple(3))));
29 }
30 
31 TEST(JoinTest, Join2) {
32  EXPECT_EQ(Join([] { return 3; }, [] { return 4; })(),
33  (Poll<std::tuple<int, int>>(std::make_tuple(3, 4))));
34 }
35 
36 TEST(JoinTest, Join3) {
37  EXPECT_EQ(Join([] { return 3; }, [] { return 4; }, [] { return 5; })(),
38  (Poll<std::tuple<int, int, int>>(std::make_tuple(3, 4, 5))));
39 }
40 
41 } // namespace grpc_core
42 
43 int main(int argc, char** argv) {
44  ::testing::InitGoogleTest(&argc, argv);
45  return RUN_ALL_TESTS();
46 }
std::tr1::make_tuple
tuple make_tuple()
Definition: cares/cares/test/gmock-1.8.0/gtest/gtest.h:1619
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::TEST
TEST(AvlTest, NoOp)
Definition: avl_test.cc:21
EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition: iomgr/time_averaged_stats_test.cc:27
main
int main(int argc, char **argv)
Definition: join_test.cc:43
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
join.h
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6106
poll.h
absl::variant
Definition: abseil-cpp/absl/types/internal/variant.h:46
grpc_core::Join
promise_detail::Join< Promise... > Join(Promise... promises)
Definition: join.h:49


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:11