diff --git a/cpp/tests/community/leiden_test.cpp b/cpp/tests/community/leiden_test.cpp index 5ce0903f723..bc58354bde7 100644 --- a/cpp/tests/community/leiden_test.cpp +++ b/cpp/tests/community/leiden_test.cpp @@ -128,6 +128,21 @@ class Tests_Leiden : public ::testing::TestWithParam(handle, clustering_v); + + unique_clustering_v = cugraph::test::unique(handle, std::move(unique_clustering_v)); + + auto expected_unique_clustering_v = cugraph::test::sequence( + handle, unique_clustering_v.size(), size_t{1}, int32_t{0}); + + auto h_unique_clustering_v = cugraph::test::to_host(handle, unique_clustering_v); + auto h_expected_unique_clustering_v = cugraph::test::to_host(handle, expected_unique_clustering_v); + + ASSERT_TRUE(std::equal(h_unique_clustering_v.begin(), + h_unique_clustering_v.end(), + h_expected_unique_clustering_v.begin())) + << "Returned cluster IDs are not numbered consecutively"; } };