From 5e0ca006f035ac44214f99d9381f0806d0cde3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Thu, 7 May 2026 10:48:12 +0800 Subject: [PATCH] test(replication): cover ETag comparison edge cases (#2840) --- .../src/bucket/replication/replication_resyncer.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/ecstore/src/bucket/replication/replication_resyncer.rs b/crates/ecstore/src/bucket/replication/replication_resyncer.rs index 96e41c09c..093b3c372 100644 --- a/crates/ecstore/src/bucket/replication/replication_resyncer.rs +++ b/crates/ecstore/src/bucket/replication/replication_resyncer.rs @@ -3988,6 +3988,12 @@ mod tests { let tgt_match = HeadObjectOutput::builder().e_tag("\"abc123\"").build(); assert!(content_matches(&src, &tgt_match), "identical ETags must match"); + let tgt_unquoted_match = HeadObjectOutput::builder().e_tag("abc123").build(); + assert!( + content_matches(&src, &tgt_unquoted_match), + "quoted and unquoted ETags with identical values must match" + ); + // version_id on the target is intentionally ignored let tgt_different_version = HeadObjectOutput::builder() .e_tag("\"abc123\"") @@ -4006,6 +4012,9 @@ mod tests { ..Default::default() }; assert!(!content_matches(&src_no_etag, &tgt_match), "missing source ETag must not match"); + + let tgt_no_etag = HeadObjectOutput::builder().build(); + assert!(!content_matches(&src, &tgt_no_etag), "missing target ETag must not match"); } #[test]