Skip to content

Commit b664f22

Browse files
Inline test cases
1 parent 9deb707 commit b664f22

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

libcxx/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,56 +38,34 @@ struct Unconstrained {
3838
TEST_CONSTEXPR_CXX14 Unconstrained(Arg arg) : data(arg) {}
3939
};
4040

41-
TEST_CONSTEXPR_CXX14 std::tuple<Unconstrained> test_cat_unary_lvalue() {
42-
auto tup = std::tuple<Unconstrained>(Unconstrained(5));
43-
return std::tuple_cat(tup);
44-
}
45-
46-
TEST_CONSTEXPR_CXX14 std::tuple<Unconstrained> test_cat_unary_rvalue() {
47-
return std::tuple_cat(std::tuple<Unconstrained>(Unconstrained(6)));
48-
}
49-
50-
TEST_CONSTEXPR_CXX14 std::tuple<Unconstrained> test_cat_unary_and_nullary() {
51-
return std::tuple_cat(std::tuple<Unconstrained>(Unconstrained(7)), std::tuple<>());
52-
}
53-
54-
#if TEST_STD_VER >= 17
55-
constexpr auto test_cat_unary_lvalue_ctad() {
56-
auto tup = std::tuple(Unconstrained(8));
57-
return std::tuple_cat(tup);
58-
}
59-
60-
constexpr auto test_cat_unary_rvalue_ctad() { return std::tuple_cat(std::tuple(Unconstrained(9))); }
61-
62-
constexpr auto test_cat_unary_and_nullary_ctad() { return std::tuple_cat(std::tuple(Unconstrained(10)), std::tuple()); }
63-
#endif
64-
6541
TEST_CONSTEXPR_CXX14 bool test_tuple_cat_with_unconstrained_constructor() {
6642
{
67-
auto tup = test_cat_unary_lvalue();
43+
auto tup_src = std::tuple<Unconstrained>(Unconstrained(5));
44+
auto tup = std::tuple_cat(tup_src);
6845
assert(std::get<0>(tup).data == 5);
6946
}
7047
{
71-
auto tup = test_cat_unary_rvalue();
48+
auto tup = std::tuple_cat(std::tuple<Unconstrained>(Unconstrained(6)));
7249
assert(std::get<0>(tup).data == 6);
7350
}
7451
{
75-
auto tup = test_cat_unary_and_nullary();
52+
auto tup = std::tuple_cat(std::tuple<Unconstrained>(Unconstrained(7)), std::tuple<>());
7653
assert(std::get<0>(tup).data == 7);
7754
}
7855
#if TEST_STD_VER >= 17
7956
{
80-
auto tup = test_cat_unary_lvalue_ctad();
57+
auto tup_src = std::tuple(Unconstrained(8));
58+
auto tup = std::tuple_cat(tup_src);
8159
ASSERT_SAME_TYPE(decltype(tup), std::tuple<Unconstrained>);
8260
assert(std::get<0>(tup).data == 8);
8361
}
8462
{
85-
auto tup = test_cat_unary_rvalue_ctad();
63+
auto tup = std::tuple_cat(std::tuple(Unconstrained(9)));
8664
ASSERT_SAME_TYPE(decltype(tup), std::tuple<Unconstrained>);
8765
assert(std::get<0>(tup).data == 9);
8866
}
8967
{
90-
auto tup = test_cat_unary_and_nullary_ctad();
68+
auto tup = std::tuple_cat(std::tuple(Unconstrained(10)), std::tuple());
9169
ASSERT_SAME_TYPE(decltype(tup), std::tuple<Unconstrained>);
9270
assert(std::get<0>(tup).data == 10);
9371
}

0 commit comments

Comments
 (0)