MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/algorithm_test.cpp:10–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace Star;
9
10TEST(any, allTests) {
11 int a = 60;
12 int asdf[] = {1, 2, 3, 4, 5, 6};
13
14 EXPECT_TRUE(any(asdf, [&](int b) { return b < a; }));
15 EXPECT_FALSE(any(asdf, [&](int b) { return b > a; }));
16 EXPECT_TRUE(any(asdf, [&](int b) { return a % b == 0; }));
17
18 bool b[] = {false, false, false, true};
19 bool c[] = {false, false, false, false};
20 bool d[] = {false, false, true, true};
21 bool e[] = {true, true, true, true};
22 int f[] = {0, 1, 0, 0, 0, 3};
23
24 EXPECT_TRUE(any(b));
25 EXPECT_FALSE(any(c));
26 EXPECT_TRUE(any(d));
27 EXPECT_TRUE(any(e));
28 EXPECT_TRUE(any(f));
29}
30
31TEST(all, allTests) {
32 int a = 60;

Callers

nothing calls this directly

Calls 14

anyFunction · 0.85
tupleApplyFunctionFunction · 0.85
tupleUnpackFunctionFunction · 0.85
AddTogetherClass · 0.85
composeFunction · 0.85
zipFunction · 0.85
tupleCallFunctionFunction · 0.85
anyMethod · 0.80
allClass · 0.50
transformedMethod · 0.45
filteredMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected