From 601dc66d7d9a3fe3a97d7292764639c410a381ed Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Sun, 6 Jul 2025 10:47:21 +0100 Subject: [PATCH] Add panic test for frame_zip method with incompatible dimensions --- src/frame/base.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/frame/base.rs b/src/frame/base.rs index 8399125..97552cc 100644 --- a/src/frame/base.rs +++ b/src/frame/base.rs @@ -1721,6 +1721,16 @@ mod tests { assert!((zipped_frame["B"][2] - 6.6).abs() < FLOAT_TOLERANCE); } + #[test] + #[should_panic(expected = "Frame::frame_zip: incompatible dimensions (self: 3x1, other: 3x2)")] + fn test_frame_zip_panic() { + let mut f1 = create_test_frame_f64(); + let f2 = create_test_frame_f64_alt(); + f1.delete_column("B"); + + f1.frame_zip(&f2, |x, y| x + y); // Should panic due to different column counts + } + // --- Element-wise Arithmetic Ops Tests --- #[test] fn test_frame_arithmetic_ops_f64() {