diff --git a/app/tests/bundle_uploads.rs b/app/tests/bundle_uploads.rs index d2ac3f45..6e3be45a 100644 --- a/app/tests/bundle_uploads.rs +++ b/app/tests/bundle_uploads.rs @@ -324,9 +324,11 @@ async fn more_entries_than_declared_fail_the_build(app: Application) -> laravel: let files = fresh_pngs(2); let id = create(&app, &token).await; register(&app, &token, &id, &files).await; - // The first file twice, then the second: three entries for two declared. + // The smaller file twice, then the other: three entries for two declared. The bundle may unpack to no more than + // the declared total, checked before each entry, so duplicating the larger file would trip that limit first. + let (small, large) = if files[0].len() <= files[1].len() { (&files[0], &files[1]) } else { (&files[1], &files[0]) }; let mut w = bundle::Writer::new(Vec::new()).unwrap(); - for f in [&files[0], &files[0], &files[1]] { + for f in [small, small, large] { w.add(&sha(f), f).unwrap(); } let bundle = send(&app, &token, &id, &declared(&files), w.finish().unwrap()).await;