Web tests: assert the browser drop counts without explicit panics

This commit is contained in:
makesomethingshit committed 2026-11-29 11:42:06 +09:00
1 parent ed7a50825f
commit 52553034cc
1 file changed
+4 -3
+4 -3
View File
@@ -78,9 +78,10 @@ mod tests {
ctx.run_ui(next, |ui| delivered.extend(drops.take(ui.ctx(), &position))).textures_delta.clear();
assert_eq!(shared_files.load(Ordering::Relaxed), 0, "the shared router must not see browser-owned drops");
let [batch] = delivered.as_slice() else { panic!("the browser UI must receive exactly one batch") };
let [file] = batch.files.as_slice() else { panic!("the browser UI must receive exactly one file") };
assert!(Arc::ptr_eq(file, &svg));
assert_eq!(delivered.len(), 1, "the browser UI must receive exactly one batch");
let batch = &delivered[0];
assert_eq!(batch.files.len(), 1, "the browser UI must receive exactly one file");
assert!(Arc::ptr_eq(&batch.files[0], &svg));
assert_eq!((batch.pos, batch.shift), (expected_pos, expected_shift));
assert!(position.get().is_none());
}