Skip to content

Commit cce0ce6

Browse files
committed
clang-formats tests
1 parent 2e9d815 commit cce0ce6

33 files changed

Lines changed: 221 additions & 201 deletions

test/test_accumulate.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include <accumulate.hpp>
22
#include "helpers.hpp"
33

4-
#include <vector>
54
#include <iterator>
65
#include <string>
6+
#include <vector>
77

88
#include "catch.hpp"
99

@@ -102,16 +102,15 @@ TEST_CASE("accumulate: iterator meets requirements", "[accumulate]") {
102102
REQUIRE(itertest::IsIterator<decltype(std::begin(a))>::value);
103103
}
104104

105-
TEST_CASE("accumulate: Works with different begin and end types",
106-
"[accumulate]") {
105+
TEST_CASE(
106+
"accumulate: Works with different begin and end types", "[accumulate]") {
107107
CharRange cr{'d'};
108108
auto a = accumulate(cr);
109109
Vec v(a.begin(), a.end());
110110
Vec vc{'a', 'a' + 'b', 'a' + 'b' + 'c'};
111111
REQUIRE(v == vc);
112112
}
113113

114-
115114
template <typename T>
116115
using ImpT = decltype(accumulate(std::declval<T>()));
117116
TEST_CASE("accumulate: has correct ctor and assign ops", "[accumulate]") {

test/test_chain.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#include "helpers.hpp"
21
#include <chain.hpp>
2+
#include "helpers.hpp"
33

4-
#include <vector>
4+
#include <iterator>
55
#include <list>
66
#include <string>
7-
#include <vector>
8-
#include <iterator>
97
#include <utility>
8+
#include <vector>
109

1110
#include "catch.hpp"
1211

@@ -39,8 +38,8 @@ TEST_CASE("chain: with different container types", "[chain]") {
3938
REQUIRE(v == vc);
4039
}
4140

42-
TEST_CASE("chain: where one container has different begin and end types",
43-
"[chain]") {
41+
TEST_CASE(
42+
"chain: where one container has different begin and end types", "[chain]") {
4443
std::string s1{"abc"};
4544
std::list<char> li{'m', 'n', 'o'};
4645
CharRange cr('e');

test/test_chunked.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#include <chunked.hpp>
22

3-
#include <vector>
43
#include <array>
54
#include <string>
65
#include <utility>
6+
#include <vector>
77

8-
#include "helpers.hpp"
98
#include "catch.hpp"
9+
#include "helpers.hpp"
1010

1111
using iter::chunked;
1212
using Vec = std::vector<int>;
@@ -60,8 +60,7 @@ TEST_CASE("chunked: size 0 is empty", "[chunked]") {
6060
REQUIRE(std::begin(g) == std::end(g));
6161
}
6262

63-
TEST_CASE("chunked: Works with different begin and end types",
64-
"[chunked]") {
63+
TEST_CASE("chunked: Works with different begin and end types", "[chunked]") {
6564
CharRange cr{'f'};
6665
std::vector<std::vector<char>> results;
6766
for (auto&& g : chunked(cr, 3)) {

test/test_combinations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
#include <combinations.hpp>
88

9+
#include <iterator>
910
#include <set>
10-
#include <vector>
1111
#include <string>
12-
#include <iterator>
12+
#include <vector>
1313

1414
#include "catch.hpp"
1515

test/test_combinations_with_replacement.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <combinations_with_replacement.hpp>
22

33
#include <iterator>
4-
#include <string>
54
#include <set>
5+
#include <string>
66
#include <vector>
77

88
#define CHAR_RANGE_DEFAULT_CONSTRUCTIBLE
@@ -33,7 +33,8 @@ TEST_CASE("combinations_with_replacement: Simple combination",
3333
REQUIRE(ans == sc);
3434
}
3535

36-
TEST_CASE("combinations_with_replacement: Works with different begin and end types",
36+
TEST_CASE(
37+
"combinations_with_replacement: Works with different begin and end types",
3738
"[combinations_with_replacement]") {
3839
CharRange cr{'d'};
3940
CharCombSet sc;

test/test_compress.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
#include "helpers.hpp"
21
#include <compress.hpp>
2+
#include "helpers.hpp"
33

4-
#include <vector>
5-
#include <string>
6-
#include <vector>
74
#include <iterator>
5+
#include <string>
86
#include <utility>
7+
#include <vector>
98

109
#include "catch.hpp"
1110

@@ -136,8 +135,7 @@ TEST_CASE("compress: iterator meets requirements", "[compress]") {
136135
REQUIRE(itertest::IsIterator<decltype(std::begin(c))>::value);
137136
}
138137

139-
TEST_CASE("compress: Works with different begin and end types",
140-
"[compress]") {
138+
TEST_CASE("compress: Works with different begin and end types", "[compress]") {
141139
CharRange cr{'d'};
142140
auto c = compress(cr, std::vector<bool>{true, false, true});
143141
Vec v(c.begin(), c.end());

test/test_count.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include "helpers.hpp"
21
#include <count.hpp>
2+
#include "helpers.hpp"
33

4-
#include <vector>
54
#include <iterator>
65
#include <utility>
6+
#include <vector>
77

88
#include "catch.hpp"
99

test/test_cycle.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#include "helpers.hpp"
44

5-
#include <vector>
6-
#include <string>
75
#include <iterator>
6+
#include <string>
7+
#include <vector>
88

99
#include "catch.hpp"
1010

@@ -17,16 +17,17 @@ TEST_CASE("cycle: iterate twice", "[cycle]") {
1717
for (auto i : cycle(ns)) {
1818
v.push_back(i);
1919
++count;
20-
if (count == ns.size() * 2) { break; }
20+
if (count == ns.size() * 2) {
21+
break;
22+
}
2123
}
2224

2325
auto vc = ns;
2426
vc.insert(std::end(vc), std::begin(ns), std::end(ns));
2527
REQUIRE(v == vc);
2628
}
2729

28-
TEST_CASE("cycle: Works with different begin and end types",
29-
"[cycle]") {
30+
TEST_CASE("cycle: Works with different begin and end types", "[cycle]") {
3031
constexpr auto sz = 'd' - 'a';
3132
CharRange cr{'d'};
3233
const std::vector<char> vc{'a', 'b', 'c', 'a', 'b', 'c'};
@@ -35,22 +36,24 @@ TEST_CASE("cycle: Works with different begin and end types",
3536
for (auto i : cycle(cr)) {
3637
v.push_back(i);
3738
++count;
38-
if (count == sz * 2) { break; }
39+
if (count == sz * 2) {
40+
break;
41+
}
3942
}
4043

4144
REQUIRE(v == vc);
4245
}
4346

44-
45-
4647
TEST_CASE("cycle: with pipe", "[cycle]") {
4748
std::vector<int> ns{2, 4, 6};
4849
std::vector<int> v;
4950
std::size_t count = 0;
5051
for (auto i : ns | cycle) {
5152
v.push_back(i);
5253
++count;
53-
if (count == ns.size() * 2) { break; }
54+
if (count == ns.size() * 2) {
55+
break;
56+
}
5457
}
5558

5659
auto vc = ns;

test/test_dropwhile.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#include "helpers.hpp"
44

5-
#include <vector>
6-
#include <string>
75
#include <iterator>
6+
#include <string>
7+
#include <vector>
88

99
#include "catch.hpp"
1010

@@ -27,10 +27,10 @@ TEST_CASE("dropwhile: skips initial elements", "[dropwhile]") {
2727
REQUIRE(v == vc);
2828
}
2929

30-
TEST_CASE("dropwhile: Works with different begin and end types",
31-
"[dropwhile]") {
30+
TEST_CASE(
31+
"dropwhile: Works with different begin and end types", "[dropwhile]") {
3232
CharRange cr{'f'};
33-
auto d = dropwhile([](char c){return c < 'c';}, cr);
33+
auto d = dropwhile([](char c) { return c < 'c'; }, cr);
3434
Vec v(d.begin(), d.end());
3535
Vec vc{'c', 'd', 'e'};
3636
REQUIRE(v == vc);
@@ -52,7 +52,7 @@ TEST_CASE("dropwhile: skips all elements when all are true under predicate",
5252
}
5353

5454
TEST_CASE("dropwhile: identity", "[dropwhile]") {
55-
Vec ns {1, 2, 0, 3, 1, 0};
55+
Vec ns{1, 2, 0, 3, 1, 0};
5656
auto d = dropwhile(ns);
5757
Vec v(std::begin(d), std::end(d));
5858
Vec vc = {0, 3, 1, 0};

test/test_enumerate.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
#include "helpers.hpp"
44

5-
#include <vector>
6-
#include <string>
75
#include <iterator>
8-
#include <utility>
96
#include <sstream>
7+
#include <string>
8+
#include <utility>
9+
#include <vector>
1010

1111
namespace Catch {
1212
template <typename A, typename B>
@@ -148,8 +148,8 @@ TEST_CASE("enumerate: works index and pipe", "[enumerate]") {
148148
REQUIRE(v == vc);
149149
}
150150

151-
TEST_CASE("enumerate: Works with different begin and end types",
152-
"[enumerate]") {
151+
TEST_CASE(
152+
"enumerate: Works with different begin and end types", "[enumerate]") {
153153
CharRange cr{'d'};
154154
auto e = enumerate(cr);
155155
Vec v(e.begin(), e.end());

0 commit comments

Comments
 (0)