Skip to content

Commit 6e7b3b1

Browse files
mikolalysenkoclaude
andcommitted
test(e2e/nuget): accept the singular crawl summary "Found 1 package"
scan now prints counted nouns ("Found 1 package (1 nuget)"), so the legacy-layout leg's "packages" substring match found no summary line. Match either number and build the breakdown needle with the right noun. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 37e8d06 commit 6e7b3b1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎crates/socket-patch-cli/tests/e2e_nuget.rs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ async fn run(args: &[&str], cwd: &Path, nuget_packages: &Path, proxy_url: &str)
8484
fn parse_found_count(combined: &str) -> usize {
8585
let line = combined
8686
.lines()
87-
.find(|l| l.contains("Found") && l.contains("packages"))
87+
// "Found 1 package (...)" / "Found N packages (...)": match the
88+
// crawl summary in either number, not the "Found N patches" line.
89+
.find(|l| l.contains("Found") && l.contains(" package"))
8890
.unwrap_or_else(|| {
8991
panic!("scan did not print a `Found N packages` line; output was:\n{combined}")
9092
});
@@ -99,7 +101,7 @@ fn parse_found_count(combined: &str) -> usize {
99101

100102
/// Assert scan reported EXACTLY `n` packages and that ALL of them were
101103
/// attributed to the NuGet ecosystem, via the contiguous breakdown line
102-
/// `Found <n> packages (<n> nuget)`.
104+
/// `Found <n> package(s) (<n> nuget)` (singular noun when `n == 1`).
103105
///
104106
/// This is deliberately stricter than checking the count and the substring
105107
/// "nuget" independently: a split-ecosystem regression that mis-attributed a
@@ -115,7 +117,8 @@ fn assert_all_nuget(combined: &str, n: usize) {
115117
found, n,
116118
"expected exactly {n} discovered packages, got {found}:\n{combined}"
117119
);
118-
let needle = format!("Found {n} packages ({n} nuget)");
120+
let noun = if n == 1 { "package" } else { "packages" };
121+
let needle = format!("Found {n} {noun} ({n} nuget)");
119122
assert!(
120123
combined.contains(&needle),
121124
"expected the contiguous breakdown line {needle:?} \

0 commit comments

Comments
 (0)