MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / TEST_CASE

Function TEST_CASE

test/unfold_test.cpp:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34using migraphx::unfold;
35
36TEST_CASE(test_basic_sequence)
37{
38 auto f = [](int x) { return x; };
39 auto g = [](int x) -> std::optional<int> {
40 return (x < 5) ? std::optional{x + 1} : std::nullopt;
41 };
42 auto rng = unfold(1, f, g);
43
44 std::vector<int> got;
45 std::copy(rng.begin(), rng.end(), std::back_inserter(got));
46
47 EXPECT(got.size() == 5);
48 EXPECT(got == std::vector<int>{1, 2, 3, 4, 5});
49}
50
51TEST_CASE(test_empty_sequence)
52{

Callers

nothing calls this directly

Calls 8

unfoldFunction · 0.85
distanceFunction · 0.85
accumulateFunction · 0.85
resizeMethod · 0.80
copyFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected