MCPcopy Create free account
hub / github.com/apache/arrow / ExpectSortPermutation

Function ExpectSortPermutation

cpp/src/arrow/util/stl_util_test.cc:63–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void ExpectSortPermutation(std::vector<std::string> unsorted,
64 std::vector<int64_t> expected_indices,
65 size_t expected_cycle_count) {
66 auto actual_indices = ArgSort(unsorted);
67 EXPECT_THAT(actual_indices, ::testing::ContainerEq(expected_indices));
68
69 auto sorted = unsorted;
70 std::sort(sorted.begin(), sorted.end());
71
72 auto permuted = unsorted;
73 EXPECT_EQ(Permute(expected_indices, &permuted), expected_cycle_count);
74
75 EXPECT_THAT(permuted, ::testing::ContainerEq(sorted));
76}
77
78TEST(StlUtilTest, ArgSortPermute) {
79 std::string f = "foxtrot", a = "alpha", b = "bravo", d = "delta", c = "charlie",

Callers 1

TESTFunction · 0.85

Calls 4

ArgSortFunction · 0.85
PermuteFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected