From 0686193b047ae6220fe8e1e7ff144da637d8d287 Mon Sep 17 00:00:00 2001 From: zjp Date: Sun, 27 Oct 2024 20:01:43 +0800 Subject: [PATCH] testcases: check workspace_tests_count --- src/repo/testcases.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/repo/testcases.rs b/src/repo/testcases.rs index e99d23e..b4f8098 100644 --- a/src/repo/testcases.rs +++ b/src/repo/testcases.rs @@ -36,6 +36,13 @@ pub fn get(repo_root: &Utf8Path, workspace_root: &Utf8Path) -> Result ele.pkg_tests_count = ele.tests.iter().map(|t| t.testcases.len()).sum(); } + let sum_pkg_tests_count: usize = map.values().map(|p| p.pkg_tests_count).sum(); + ensure!( + sum_pkg_tests_count == workspace_tests_count, + "test cases count are not equal: sum_pkg_tests_count ({sum_pkg_tests_count}) \ + ≠ workspace_tests_count ({workspace_tests_count})" + ); + Ok(map) }